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
Summary row and colmodel options
10/02/2011
17:20
Avatar
lotjuh
Member
Members
Forum Posts: 28
Member Since:
06/09/2009
sp_UserOfflineSmall Offline

Hi Tony,

I'm trying to get a summary row just as shown in your Demos -> Grouping -> Summary Footers example, but I don't want to use the grouping function.

I tried to add the summaryType and summaryTpl options to my colmodel columns, but it seems to ignore these option when grouping is not set to true.

Is there anyway to get the same result as in your example without enabling grouping and without using the userDataOnFooter option? If not, wouldn't it be a good idea to implement the summary footer for ungrouped rows the same as you've implemented for grouped rows?

Kind Regards,

Lotte-Sara

10/02/2011
18:48
Avatar
tony
Sofia, Bulgaria
Moderator
Members

Moderators
Forum Posts: 7721
Member Since:
30/10/2007
sp_UserOfflineSmall Offline

Hello,

Some things happen as tey are defined, otherviese not.

To answer of your question - I think yes this is possible,

Just use the method footerData

http://www.trirand.com/jqgridw.....ki:methods

Regards

Tony

For professional UI suites for Java Script and PHP visit us at our commercial products site - guriddo.net - by the very same guys that created jqGrid.

24/02/2011
16:18
Avatar
lotjuh
Member
Members
Forum Posts: 28
Member Since:
06/09/2009
sp_UserOfflineSmall Offline

Hoi Tony,

It seems to me that the footerData method is basically the same as using userDataOnFooter because you have to feed it an array with name:value pairs. I don't want to calculate the totals myself, I want jqgrid to do this for me based on the given summaryType and summaryTpl in my colModel options. This is all done for you when grouping is enabled, but when grouping is disabled, these options are ignored.

 'colModel'        : [
     { 'name': 'fldVerkoopOrderRegelID','index': 'fldVerkoopOrderRegelID', 'hidden': true },
     { 'name': 'fldArtikelcode',        'index': 'fldArtikelcode',      'width': 120, 'fixed': true,     'summaryTpl': '<stong>Totaal</strong>'
       'editable': true, 'formatter': $.unitTbookOrders.orderTypeFormatter },
     { 'name': 'fldOmschrijving',       'index': 'fldOmschrijving' },
     { 'name': 'fldAantalVerkocht',     'index': 'fldAantalVerkocht',   'width': 50, 'fixed': true, 'sorttype': 'float', 'formatter': 'number' },
     { 'name': 'fldVerkoopprijs',       'index': 'fldVerkoopprijs',     'width': 50, 'fixed': true, 'sorttype': 'float', 'formatter': 'number' },
     { 'name': 'fldRegelkorting',       'index': 'fldRegelkorting',     'width': 50, 'fixed': true, 'sorttype': 'float', 'formatter': 'number' },
     { 'name': 'fldBedragNaKortingen',  'index': 'fldBedragNaKortingen','width': 50, 'fixed': true,
       'sorttype': 'float', 'formatter': 'number', 'summaryType': 'sum' }
 ],

Regards,

Lotte-Sara Laan

24/02/2011
20:21
Avatar
OlegK
Germany
Member
Members
Forum Posts: 1255
Member Since:
10/08/2009
sp_UserOfflineSmall Offline

Hi Lotte-Sara,

If you want calculate a sum from the cells in one column in the current page you can do this with respect of getCol methed

var sum = $("list").jqGrid('getCol','fldBedragNaKortingen',false,'sum');

Then with respect of

$("list").jqGrid('footerData','set',{fldArtikelcode:'Summary',fldBedragNaKortingen:sum});

you can place the sum in the footer.

Best regards
Oleg 

05/04/2011
12:42
Avatar
generalshiva
New Member
Members
Forum Posts: 1
Member Since:
05/04/2011
sp_UserOfflineSmall Offline

what is "list" in the context???

06/04/2011
19:26
Avatar
OlegK
Germany
Member
Members
Forum Posts: 1255
Member Since:
10/08/2009
sp_UserOfflineSmall Offline

I mean of course $("#list") instead of $("list"), where "list" is the id of the table element of jqGrid.

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

Currently Online:
60 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