getting the sum using footerdata on jqgrid(使用 jqgrid 上的 footerdata 获取总和)
问题描述
我有一个列名 Total.
而且我也在使用页脚
jqgrid 的值.
I have a column name Total.
And I'm also using the footer
value of the jqgrid.
例如这是列
总计
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});
推荐答案
你应该发布更完整的代码来重现问题.我尝试了一些选项:输入数据为字符串,数据为整数,使用 formatter: "integer",不使用格式化程序等等.
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 获取总和的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:使用 jqgrid 上的 footerdata 获取总和
基础教程推荐
- 检查 HTML5 拖放文件类型 2022-01-01
- 即使用户允许,Gmail 也会隐藏外部电子邮件图片 2022-01-01
- 如何添加到目前为止的天数? 2022-01-01
- fetch 是否支持原生多文件上传? 2022-01-01
- Bokeh Div文本对齐 2022-01-01
- 原生拖动事件后如何获取 mouseup 事件? 2022-01-01
- 在 contenteditable 中精确拖放 2022-01-01
- npm start 错误与 create-react-app 2022-01-01
- Fabric JS绘制具有活动形状的多边形 2022-01-01
- Bootstrap 模态出现在背景下 2022-01-01
