Hi,
I have a grid which has two 'debit' 'credit' columns & I want to show the sum of these columns in my summaries. The issue I am facing is this that the sum is calculated only for the rows which are part of the grid's datasource or more specifically the rows which are loaded through DataSourcUrl, I have also allowed to Add New Rows to the grid, But the rows which are added through AddNewRows are not being calculated by the summaries. From what I know is that the summaries is only calculating the sum of rows which are committed & not the ones in the igTransactions.
What should be done to calculate the sum of normal rows(already-added(commited)) as well as those rows which are added later by the user through the "AddNewRow" button after the grid data is rendered. In simpler words How to calculate sum of already added rows as well as rows which are currently in 'igTransaction'.
Thanks.
I have set AutoCommit(true) but still new rows are not being calculated. Also if autoCommit is set to true, Does the UpdateUrl automatically gets called immediately after a new row is added every time? If this is the case than I dont want that to happen. I want to send all the new rows in a batch with my form model & not individually everytime.
Also are the igTransaction empties everytime when a new row is added? If yes than how would I get the newly added rows in my javascripot function to send them manually to the server along with my Form's model. Also please note that I have intentionally decided to not use the saveChanges (UpdateUrl) method because of some reasons therefore I need the igTransactions as well and dont want them emptied every time a new row is added.
AutoCommit is set to true still summaries are not being calculated for all rows.
And I console.logged() "allTransactions" as well as "dataSource" of grid and in igTransactions I have 1 row & in dataSoruce I have 3 rows(2 rows from original datasource+1 of igTransaction) which means my dataSource now contains 3 rows but the summaries is only calculated for 2 rows. What am I doing wrong?
Hello Zep lin,
As the grid in this case is bound to the result of an MVC method, the saveChanges method needs to be invoked in order to commit the new rows in the controller. After that, the summaries should be updated. Note that the autoCommit method commits the changes only in the datasource instantiated on the client.
https://www.igniteui.com/help/14.2/iggrid-updating
Hope this helps. Please feel free to contact me if you have any questions.
Basically I want the functionality of aggregateTransactions but I also want to set AutoCommit(true) because I need Summaries of newly added rows.
------------------------------------------------------------------------------
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.
Thank you for your reply. Glad to hear that you were able to find a solution to your issues.
Feel free to contact me if I can provide you with any additional information.
Hello Petar, thanks for your concern. I have now implemented my own summary calculation on client side and I am not using igGrid's builtin Summaries feature because of the above mentioned issues.
If I set autoCommit = true , my Summaries feature starts working but I get too many transactions for a single row on server side & it was impossible for me to figure out which one was the latest because I dont actually call the saveChanges() method immediately on row events,rather I waited for all the transactions to finish & then catch all the transactions in a batch on server side & therefore autoCommit= true made my scenario not workable.
If I set autoCommit to false, transactions issue was solved but summaries for newly added rows were not being calculated.
Any how I have now written my own methods for manually calculating summaries for all rows after every grid event.
Thanks for your time.
Please feel free to contact me if you have any further questions regarding this matter.
Hello Zep Lin,
I am not sure if I understand the issue with manually calling $("#grid").igGrid("commit") upon adding a new row? Using AutoCommit would commit the change on the client in any case. Here calling it manually would allow the recalculation of the summaries while the transactions can be sent to the server using the manual call subsequently.
Please let me know if I have misunderstood the issue in any way.
Hello Petar, I am not committing the rows on rowAdded event. I commit the rows manually when the user clicks on the submit button of the form. Please see Post#5 in this thread I have explained why I am using this approach. If what I am aiming for is not possible, then is there any workaround? Can I manually claculate summaries of all rows in grid (transaction rows as well as datasource rows).