This is my first post in this forum, so please, be patient with me.
I need to set my summary to show the sum of all rows in my grid, even the rows that are inside other pages – the absolute sum of values.
I was searching for it, and I saw a lot of people with this problem, so I don’t think it is a problem with my code. It sounds more like a design in the grouping mechanism itself, otherwise I don’t know.
But, to be clear, I think I need to make a call to server side to get the sum from there, is this possible? If so, how should I do it with json?
I was thinking about using the formatter option, but then it is triggered line by line, and I don’t think this is the idea because the sum will come entire in the first call.
Any suggestions?
Thanks !!!
You can define a custom
summaryTypefunction to display your sum. According to the documentation forsummaryType:For example, you could retrieve a
totalSumRecordwhen the page is loaded – it would be a bad idea to make an AJAX call directly from the formatter – and then just display the appropriate value in the formatter:Update
There is a bug in jqGrid 4.4 where functions are not allowed as a summary type. If this affects you, here is the fix.