Forum

November 2nd, 2014
A A A
Avatar

Lost password?
Advanced Search

— Forum Scope —




— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

The forums are currently locked and only available for read only access
sp_Feed Topic RSS sp_TopicIcon
group summary in the header
12/12/2010
13:44
Avatar
paul78
New Member
Members
Forum Posts: 1
Member Since:
12/12/2010
sp_UserOfflineSmall Offline

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

21/08/2013
08:57
Avatar
Ram
Member
Members
Forum Posts: 4
Member Since:
21/08/2013
sp_UserOfflineSmall Offline

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

21/08/2013
09:10
Avatar
Ram
Member
Members
Forum Posts: 4
Member Since:
21/08/2013
sp_UserOfflineSmall Offline

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

21/08/2013
09:11
Avatar
Ram
Member
Members
Forum Posts: 4
Member Since:
21/08/2013
sp_UserOfflineSmall Offline

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/

26/08/2013
09:20
Avatar
Ram
Member
Members
Forum Posts: 4
Member Since:
21/08/2013
sp_UserOfflineSmall Offline

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);

 

}

Forum Timezone: Europe/Sofia

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.com

Moderators: tony: 7721, Rumen[Trirand]: 81

Administrators: admin: 66

Comments are closed.
Privacy Policy   Terms and Conditions   Contact Information