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
2165
The right way to set a igHierarchicalGrid and get transactions
posted

What is the right way to set a two level igHierarchicalGrid for batch updating and get its aggregated transactions in the client?

In the attached example (inspired on some code found in this forum) the grid let the user to add, modify and delete rows from level 1 (categories) and level 2 (products). For simplicity in this example I am not catching deleted rows. The problem is that I can't get transactions from level 2. Also, in order to add rows at level 2 AutoCommit must be set to true (when parent row is new) , this is an issue because a) I cant use aggregated transactions (according to documentation: This option takes effect only when autoCommit is set to false), that means bigger packets sent to the server, b) italics applied to edited rows are lost so user can't see what has been edited. Is there a way to fix this?

IgHierarchicalGridDemo.rar
Parents
No Data
Reply
  • 49378
    posted

    Hello Luis,

    The transactions for the child bands can be accessing through each respective child layout. For instance, to get the current transactions of the first child grid, something similar to the following may be used:

    $($("#MyGrid").igHierarchicalGrid("allChildren")[0]).igGrid("allTransactions")

    In order to retain aggregate transactions and respectively, disabled AutoCommit on the root layout, I would suggest handling the rowAdded event and invoking commit manually:

       //Bind after initialization    
        $(document).delegate("#MyGrid", "iggridupdatingrowadded", function (evt, ui) {

            $("#MyGrid").igGrid("commit");
        });

    Hope this helps. Please feel free to contact me if you have any questions.

    IgHierarchicalGridSimpleDemoUpload.zip
Children