找回密码
 立即注册

QQ登录

只需一步,快速开始

mtkj
金牌服务用户   /  发表于:2020-8-15 20:14  /   查看:5653  /  回复:10
1金币
附件: 您需要 登录 才可以下载或查看,没有帐号?立即注册

最佳答案

查看完整内容

您好,从代码分析,可能与CustomerEdit有关,但还没有能够找到问题的原因,需要更多时间来分析。

10 个回复

倒序浏览
最佳答案
最佳答案
KevinChen讲师达人认证 悬赏达人认证 SpreadJS 开发认证
论坛元老   /  发表于:2020-8-15 20:14:23
来自 10#
您好,从代码分析,可能与CustomerEdit有关,但还没有能够找到问题的原因,需要更多时间来分析。
回复 使用道具 举报
KevinChen讲师达人认证 悬赏达人认证 SpreadJS 开发认证
论坛元老   /  发表于:2020-8-17 13:20:22
2#
你好,参考以下代码:

  1. import 'bootstrap.css';
  2. import '@grapecity/wijmo.styles/wijmo.css';
  3. import './styles.css';
  4. import * as wjGrid from '@grapecity/wijmo.grid';
  5. //
  6. document.readyState === 'complete' ? init() : window.onload = init;
  7. //
  8. function init() {
  9.     //
  10.     // generate some random data
  11.     var countries = 'US,Germany,UK,Japan,Italy,Greece'.split(','), products = 'Phones,Computers,Cameras,Stereos'.split(','), data = [];
  12.     for (var i = 0; i < 200; i++) {
  13.         data.push({
  14.             id: i,
  15.             country: countries[i % countries.length],
  16.             product: products[i % products.length],
  17.             sales: Math.random() * 10000 + "",
  18.             expenses: Math.random() * 5000,
  19.         });
  20.     }
  21.     //
  22.     // show aggregates below the data
  23.     var theGrid = new wjGrid.FlexGrid('#theGrid', {
  24.         autoGenerateColumns: false,
  25.         columns: [
  26.             { binding: 'id', header: 'ID', width: 60, isReadOnly: true },
  27.             { binding: 'country', header: 'Country' },
  28.             { binding: 'product', header: 'Product' },
  29.             { binding: 'sales', header: 'Sales'},
  30.             { binding: 'expenses', header: 'Expenses', aggregate: 'Sum' }
  31.         ],
  32.         itemsSource: data,
  33.         cellEditEnded: function(s,e){
  34.             console.log(e);
  35.             var col = e.col;
  36.             if(s.columns[e.col].binding === 'sales'){
  37.                 for(let i=0; i<s.rows.length; i++){
  38.                     console.log(s.getCellData(i, col));
  39.                 }
  40.             }
  41.             // 计算结果放到这里:
  42.             s.columnFooters.setCellData(0,col,"计算结果")
  43.         }
  44.     });
  45.     theGrid.columnFooters.rows.push(new wjGrid.GroupRow());
  46.     theGrid.bottomLeftCells.setCellData(0, 0, 'Σ');
  47. }
复制代码


示例地址:https://demo.grapecity.com.cn/wi ... Belowthedata/purejs

以上代码完整替换app.js即可看到效果。
回复 使用道具 举报
mtkj
金牌服务用户   /  发表于:2020-8-17 15:39:57
3#

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?立即注册

x
回复 使用道具 举报
KevinChen讲师达人认证 悬赏达人认证 SpreadJS 开发认证
论坛元老   /  发表于:2020-8-17 16:51:07
4#
您好,实际上这里应该是没必要设置字符串类型的,您需要的只是给一个计算结果的数字即可。
回复 使用道具 举报
mtkj
金牌服务用户   /  发表于:2020-8-17 18:33:56
5#
我是直接求和赋值的,但是就是报这个错

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?立即注册

x
回复 使用道具 举报
KevinChen讲师达人认证 悬赏达人认证 SpreadJS 开发认证
论坛元老   /  发表于:2020-8-17 18:42:16
6#
本帖最后由 KevinChen 于 2020-8-19 09:00 编辑

您好,这个问题未能重现,麻烦请提供一下您的Demo示例,谢谢~
回复 使用道具 举报
mtkj
金牌服务用户   /  发表于:2020-8-19 13:09:08
7#
这个问题能帮忙解决下吗
回复 使用道具 举报
mtkj
金牌服务用户   /  发表于:2020-8-19 14:18:38
8#

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?立即注册

x
回复 使用道具 举报
KevinChen讲师达人认证 悬赏达人认证 SpreadJS 开发认证
论坛元老   /  发表于:2020-8-19 16:55:37
9#
收到,问题已重现,这个问题需要一些时间排查您的代码,预计明天之内回复。
回复 使用道具 举报
12下一页
您需要登录后才可以回帖 登录 | 立即注册
返回顶部