Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
455
jQuery iGrid transactionsAsString method
posted

I am trying to use the 'transactionsAsString' utility function client side to capture the list of transactions so that I can manually post them to a server side method for processing.

var transactions = $("#grid1").igGrid("transactionsAsString");

Some documentation that I found states..

'This utility function serializes the accumulated global transaction log, not the local one.'

http://ko.infragistics.com/community/blogs/angel_todorov/archive/2011/11/14/jquery-grids-unleashed-flat-grid-architecture-javascript.aspx

So, when using this function client side, I end up with multiple transactions per row if I have made multiple edits on that row.

My question is simple, how do I get the aggregated (NOT accumulated) transaction list on the client side?  This would be the same list accessed through the Request object if using the 'saveChanges' function to trigger the ajax call to the UpdateURL method.

gridModel.LoadTransactions<GmiProduct>(HttpContext.Request.Form["ig_transactions"])

 

 

Parents
  • 24671
    posted

    Hi,

    you can set the igGrid's aggregateTransactions (option, or Property if you use MVC ) to true, and this will ensure transaction entries are aggregated. Save changes doesn't perform any aggregation, the actual aggregation is done in real time while you are editing. so you should get the same results for transactionsAsString and saveChanges, when aggregateTransactions is true, because both of those methods access the accumulatedTransaction log, without doing anything extra.

    Hope it helps. Thanks

    Angel

Reply Children
  • 2165
    Offline posted in reply to Mike Siewert

    I was facing the same problem. Looking at http://help.infragistics.com/jQuery/2014.1/ui.iggrid I found this key information about aggregateTransactions option:

    If set to true, the following behavior will take place:
    if a new row is added, and then deleted, there will be no transaction added to the log 
    if a new row is added, edited, then deleted, there will be no transaction added to the log
    if several edits are made to a row or an individual cell, this should result in a single transaction
    Note: This option takes effect only when autoCommit is set to false.

    You have to make a decision, to use or not to use auto commit. If you want aggregated transactions then you can't use auto commit. ;)