Total in footer returns NaN when column formatter is "number" or "currency"

QuestionsTotal in footer returns NaN when column formatter is "number" or "currency"
Richard Kooijman asked 11 years ago

Hi,
Total calc in footer returns NaN when column formatter is set to "number" or "currency"
When formatter setting is removed, the footer value is calculated and displayed correctly.
This is probably due to the fact that formatted value is handled as string io value.
Any way to solve this? I want to show the values using "," as dec separator and "." as thousands separator.

loadcomplete setting:
var grid = $("#customers"),
sum = grid.jqGrid('getCol', 'total', false, 'sum');
grid.jqGrid('footerData','set', { total: 'total: ' + sum });

1 Answers
toki answered 11 years ago

Hi Richard,

I also get same problem. The solution is by Abu Ghufran;

If you remove String Total and just put sum it will work.

grid.jqGrid('footerData','set', {total:sum});

Reason is, it is trying to format string "Total" to Numeric value, which is not doable. Either you can put the summary data at some other column, instead at end of total column which has default formatter (non-numeric).

Regards…

Your Answer

3 + 5 =

Login with your Social Id:

OR, enter

Attach code here and paste link in question.
Attach screenshot here and paste link in question.



How useful was this discussion?

Click on a star to rate it!

Average rating 0 / 5. Vote count: 0

No votes so far! Be the first to rate it.

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?