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 获取总和


- Flexslider 箭头未正确显示 2022-01-01
- CSS媒体查询(最大高度)不起作用,但为什么? 2022-01-01
- Css:将嵌套元素定位在父元素边界之外一点 2022-09-07
- 使用RSelum从网站(报纸档案)中抓取多个网页 2022-09-06
- 400或500级别的HTTP响应 2022-01-01
- addEventListener 在 IE 11 中不起作用 2022-01-01
- 如何使用 JSON 格式的 jQuery AJAX 从 .cfm 页面输出查 2022-01-01
- 失败的 Canvas 360 jquery 插件 2022-01-01
- Fetch API 如何获取响应体? 2022-01-01
- Quasar 2+Apollo:错误:找不到ID为默认的Apollo客户端。如果您在组件设置之外,请使用ProvideApolloClient() 2022-01-01