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_Related Related Topics sp_TopicIcon
Jqgrid Group Header Text displaying Sum
Tags: jqgrid
04/09/2013
00:51
Avatar
Rekha
New Member
Members
Forum Posts: 1
Member Since:
03/09/2013
sp_UserOfflineSmall Offline

Hi,

This is regarding Jqgrid Group Header Text displaying Sum in the group Text.

I want the sum of a particular group displayed in the group header. I found this approach on the http://trirand.com/blog/jqgrid.....qgrid.html  demo site and it works. This issue is that, when I am trying to sum a currency, the group text  displays “3117.1499999999996”  The extra trailing decimals show up. But when I display on the group Summary, it displays fine as “3117.15”.

colModel: [ ……….

{ name: 'Amount', sortable: true, formatter: 'currency', align: "right", sorttype: 'currency', decimalPlaces: '2', summaryType: 'sum', defaultValue: '0.00' }]

groupingView: {

                    groupField: ['Order'],

                    groupDataSorted: true,

                    groupText: ['<b> {0}  </b>  Total Amount: {Amount}’],

                    groupColumnShow: [true],

                    groupSummary: [true],

                    groupCollapse: true,

                    groupOrder: ['asc'],

                    showSummaryOnHide: false,

                },

Please help.

Thank s & Regards

Rekha

23/07/2014
10:32
Avatar
rize
Member
Members
Forum Posts: 5
Member Since:
21/07/2014
sp_UserOfflineSmall Offline

Rekha said
Hi,

This is regarding Jqgrid Group Header Text displaying Sum in the group Text.

I want the sum of a particular group displayed in the group header. I found this approach on the http://trirand.com/blog/jqgrid.....qgrid.html  demo site and it works. This issue is that, when I am trying to sum a currency, the group text  displays “3117.1499999999996”  The extra trailing decimals show up. But when I display on the group Summary, it displays fine as “3117.15”.

colModel: [ ……….

{ name: 'Amount', sortable: true, formatter: 'currency', align: "right", sorttype: 'currency', decimalPlaces: '2', summaryType: 'sum', defaultValue: '0.00' }]

groupingView: {

                    groupField: ['Order'],

                    groupDataSorted: true,

                    groupText: ['<b> {0}  </b>  Total Amount: {Amount}’],

                    groupColumnShow: [true],

                    groupSummary: [true],

                    groupCollapse: true,

                    groupOrder: ['asc'],

                    showSummaryOnHide: false,

                },

Please help.

Thank s & Regards

Rekha

 

Hi,

I also have this exact problem , it does the same with number formatting as well not just currency. 

I have tried using a function to return the trimmed value but I don't know how to pass the value {0} or {Amount}  into the function.

" groupText: ['<b> {0}  </b>  Total Amount: "+ formatAmount('{Amount}')], "   just passes  in the string

Does anyone know the fix or work around.

I am desperate.

 

Thanks

Ryan

23/07/2014
13:25
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

Hello,

To fix the problem you will need to use summaryRound and/or summaryRoundType in the colModel definition.
See here.

Regards

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.

23/07/2014
17:18
Avatar
rize
Member
Members
Forum Posts: 5
Member Since:
21/07/2014
sp_UserOfflineSmall Offline

You are a life saver ... this was driving me insane.

Works perfectly.

 

Thanks again.

Ryan

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

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