I am implementing JQGrid and sending the datatype as JSON. Also, I’ve set loadonce as true, and I am able to get the footer summary correctly in the footer.
However, on page navigation, the total value changes according to the row data in each page. My requirement is to display the grand total of all the records of the particular column so that the footer value remains same on page change.
I am using the following code to get the footer summary:
var grid=$("#mygrid");
sum = grid.jqGrid('getCol','amount',false,'sum');
grid.jqGrid('footerData','set',{ID:'Total:',amount:sum});
You can use
userDataOnFooteroption to achieve your goal. First you set this option totruewhile initializing:After that you can send the values for footer row in your response, JSON should look something like this:
There is also live example available on jqGrid Demos page, you should choose “New in Version 3.5” and then “Summary Footer Row”.