Forum
00:51
03/09/2013
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
10:32
21/07/2014
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
13:25
Moderators
30/10/2007
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.
Most Users Ever Online: 715
Currently Online:
49 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