在jqgrid上使用footerdata获取总和 [英] getting the sum using footerdata on jqgrid

查看:2138
本文介绍了在jqgrid上使用footerdata获取总和的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的列名为Total。

我还使用了jqgrid的页脚价值

I have a column name Total.
And I'm also using the footer
value of the jqgrid.

示例这是列

总计¥b $ b 100

-98
$
-76

98¥
76
¥

Total
100
-98
-76
98
76

如何使用页脚数据获取行的总和

how can I get the sum of the row
using the footer data.

这是我的码。

注意:如果我使用'sum',它会给我'NaN'

的价值。

here is my code.
note: if i use 'sum' it gives me 'NaN'
value.

var parseTotal= grid.jqGrid('getCol', 'Total', false, 'sum');
grid.jqGrid('footerData', 'set', { Total: parseTotal});


推荐答案

您应该发布更多可以重现问题的完整代码。我尝试了一些选项:输入数据为字符串,数据为整数,使用格式化程序:整数,不使用格式化程序等等。

You should post more full code which reproduce the problem. I tried some options: the input data as string, the data as integers, using formatter: "integer", using no formatters and so on.

我发现没有产生描述结果的列定义的输入数据。请查看演示

I found no input data of no column definition which produce the described results. Look at the demo

这与你的非工作演示有效。我希望您能在代码中找到错误。

which works and compare with your non working demo. I hope you will find the error in your code.

这篇关于在jqgrid上使用footerdata获取总和的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆