Forum
13:44
12/12/2010
Hi guys,
first of all I want to say that you've done a great job with this application! I really like it.
I use grouping a lot and want to show the summary footer along with it. But this will give me 2 rows when all rows collapsed. It would be very nice if the header could provide the summary information so that a single row would be enough.
Cheers!
Paul
08:57
21/08/2013
Hello,
I have a similar requirement. Is there some way to accomplish this?
1. Want the summary info appearing in the group header row instead of footer. By group header row, I mean the rows with the + sign.
2. Using CustomFormatter and options.rowId containing "ghead_" we can decide what needs to be displayed in the group header row. But, this gets called before the Summary Function (summaryType: customSummary). So, the summary info would not be available at the time of rendering the header row.
How to extract the summary info constructed through a cusotm summary function and display on the group header row?
I'm using jqgrid 4.5.2.
Regards,
Ram
09:10
21/08/2013
Searching a bit on the forum found /blog/?page_id=393/help/jqgrid-how-do-i-sum-the-values-in-columns-and-use-result/. Though not related, thought found something interesting. Basically an opportunity to run some code after loading completes.
Can this be used to copy rows/info from summary footer onto the group header row and then discard/hide summary footer rows?
Regards,
Ram
09:11
21/08/2013
Link in my previous post seems broken. Sharing again.
/blog/?page_id=393/help/jqgrid-how-do-i-sum-the-values-in-columns-and-use-result/
page_id=393/help/jqgrid-how-do-i-sum-the-values-in-columns-and-use-result/
09:20
21/08/2013
I could solve this with a slight hack...
In Loadcomplete handler, we need to extract contents of the summary footer and add them to the group header row.
$("#" + treeId + " tr.jqfoot").each(function () {
var summaryrow = $(this);
var level = summaryrow.attr('jqfootlevel');
var groupSelector = 'tr.jqgroup.' + treeId + 'ghead_' + level + ':first';
// get matching previous group row for level. prev doesn't work so using prevAll. //http://stackoverflow.com/questions/5778092/jquery-selector-for-previous-instance-of-a-class
var grouprow = summaryrow.prevAll(groupSelector);
// grouprow by default stretches to entire table.
// reduce that to occupy till first column. as we will add other columns from footer.
grouprow.children('td').attr('colSpan', 1);
// get other columns
var childrenSkipFirst = summaryrow.children(':nth-child(n+' + (2) + ')'); // 1 based index
summaryrow.children().remove(); // remove the non-result columns left over, this will hide the summary row.
grouprow.append(childrenSkipFirst);
}
Most Users Ever Online: 715
Currently Online:
17 Guest(s)
Currently Browsing this Page:
1 Guest(s)
Top Posters:
OlegK: 1255
markw65: 179
kobruleht: 144
phicarre: 132
YamilBracho: 124
Renso: 118
Member Stats:
Guest Posters: 447
Members: 11373
Moderators: 2
Admins: 1
Forum Stats:
Groups: 1
Forums: 8
Topics: 10592
Posts: 31289
Newest Members:
, razia, Prankie, psky, praveen neelam, greg.valainis@pa-tech.comModerators: tony: 7721, Rumen[Trirand]: 81
Administrators: admin: 66