找回密码
 立即注册

QQ登录

只需一步,快速开始

IvanBy
金牌服务用户   /  发表于:2015-5-6 10:07  /   查看:10570  /  回复:10
如果对某一个单元设置了数据绑定路径,大略代码如下:
  1. function BindingPathCellType() {
  2.         $.wijmo.wijspread.TextCellType.call(this);
  3.     }

  4.     BindingPathCellType.prototype = new $.wijmo.wijspread.TextCellType();
  5.     BindingPathCellType.prototype.paint = function (ctx, value, x, y, w, h, style, context) {
  6.         if (value === null || value === undefined) {
  7.             var sheet = context.sheet, row = context.row, col = context.col;
  8.             if (sheet && (row === 0 || !!row) && (col === 0 || !!col)) {
  9.                 var bindingPath = sheet.getBindingPath(context.row, context.col);
  10.                 if (bindingPath) {
  11.                     value = "[" + bindingPath + "]";
  12.                 }
  13.             }
  14.         }
  15.         $.wijmo.wijspread.TextCellType.prototype.paint.apply(this, arguments);
  16.     };
  17.   var bindingPathCellType = new BindingPathCellType();
  18.         sheet.getCell(5, 0).bindingPath("name").cellType(bindingPathCellType).vAlign($.wijmo.wijspread.VerticalAlign.bottom);
复制代码


然后,在拖拉填充进行单元格复制时,会把第一个单元格的bindingpath、tag一起复制了。
请问,speadjs有没有相关的选项参数可以设定复制/填充时,避免把bindingpath、tag一起复制?
谢谢

本帖子中包含更多资源

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

x

10 个回复

倒序浏览
Alice
社区贡献组   /  发表于:2015-5-6 14:41:00
沙发
回复 1楼IvanBy的帖子

感谢你对该问题的反馈。
我给你的问题的理解是,你使用dragfill功能的时候,不需要复制bindingpath,tag等信息。
你的问题我们收到了,校验后给你回复。
请点击评分,对我的服务做出评价!  5分为非常满意!

葡萄城控件服务团队

官方网站: http://www.gcpowertools.com.cn
回复 使用道具 举报
IvanBy
金牌服务用户   /  发表于:2015-5-6 16:34:00
板凳
回复 2楼Alice的帖子

是的。谢谢了
回复 使用道具 举报
Alice
社区贡献组   /  发表于:2015-5-6 17:10:00
地板
回复 1楼IvanBy的帖子

你好。
SpreadJS的dragFill有defaultDragFillType可以控制默认的拖拽填充行为。
你可以使用defaultDragFillType的FillWithoutFormatting,避免复制bindingPath。
但tag属于cell数据的一部分,因此无法通过这个属性进行控制。

根据你的描述,提供的解决方案是:使用DragFillBlock事件,在事件中将目标区域的bindingPath和Tag进行Cache。然后使用DragFillBlockCompleted事件 ,在事件中将目标区域的bindingPath和Tag进行恢复。
具体请参考文档:
http://helpcentral.componentone.com/NetHelp/SpreadHClientUG/Spread~$.wijmo.wijspread.Events~DragFillBlock_EV.html
http://helpcentral.componentone.com/NetHelp/SpreadHClientUG/Spread~$.wijmo.wijspread.Events~DragFillBlockCompleted_EV.html
请点击评分,对我的服务做出评价!  5分为非常满意!

葡萄城控件服务团队

官方网站: http://www.gcpowertools.com.cn
回复 使用道具 举报
IvanBy
金牌服务用户   /  发表于:2015-5-7 17:29:00
5#
回复 4楼Alice的帖子


Alice,你好。
我现在就是使用DragFillBlockCompleted事件进行处理。只是,在新版本2015中,事件中的info.fillRange变成未定义了,这个Bug之前已经提交到您们的英文网站。所以,才希望能不能有其它办法。谢谢啦!
  1. onDragFillBlockCompleted: function (e, info) {
  2.             setTimeout(function () {
  3.                 if (info.fillDirection == 1 || info.fillDirection == 0) {
  4.                     var row = info.fillRange.row,
  5.                         totalCol = info.fillRange.colCount,
  6.                         startCol = info.fillRange.col;
  7.                     for (var i = 0; i < totalCol; i++) {
  8.                         var col = info.fillDirection == 1 ? startCol + i : startCol + totalCol - i - 1;
  9.                         clearPathAndTag(info.sheet.getCell(row, col));
  10.                     }
  11.                 }
  12.                 else if (info.fillDirection == 3 || info.fillDirection == 2) {
  13.                     var col = info.fillRange.col,
  14.                         totalRow = info.fillRange.rowCount,
  15.                         startRow = info.fillRange.row;
  16.                     for (var j = 0; j < totalRow; j++) {
  17.                         var row = info.fillDirection == 3 ? startRow + j : startRow + totalRow - j - 1;
  18.                         clearPathAndTag(info.sheet.getCell(row, col));
  19.                     }
  20.                 }
  21.             }, 100);
  22.             function clearPathAndTag(cell) {
  23.                 var bakVal = cell.value();
  24.                 cell.tag(null);
  25.                 cell.bindingPath(null);
  26.                 cell.value(bakVal);
  27.             }
  28.         }
复制代码
回复 使用道具 举报
Alice
社区贡献组   /  发表于:2015-5-8 09:14:00
6#
回复 5楼IvanBy的帖子

你好。
感谢你的反馈和支持。你所反馈的bug已经在最新版的SpreadJS修复。
目前最新版的SpreadJS已经从wijmo中分离出来,可以单独购买节省你的开支。或者购买Spread studio套包,它包含其中。
由于wijmo中的spreadjs今后不再维护和更新,我们建议你下载和使用最新版的包含在Spread studio中的SpreadJS。
下载链接:
http://www.gcpowertools.com.cn/products/download.aspx?pid=54
请点击评分,对我的服务做出评价!  5分为非常满意!

葡萄城控件服务团队

官方网站: http://www.gcpowertools.com.cn
回复 使用道具 举报
IvanBy
金牌服务用户   /  发表于:2015-5-8 15:04:00
7#
回复 6楼Alice的帖子

那以后关于SpreadJS的问题,在哪里进行反馈?以及维护更新的消息,在哪里获取?
谢谢~
回复 使用道具 举报
IvanBy
金牌服务用户   /  发表于:2015-5-8 15:09:00
8#
回复 6楼Alice的帖子

最新版的SpreadJS是 2015v1,还是2015v2(还没看到可以下载的链接)?
回复 使用道具 举报
Alice
社区贡献组   /  发表于:2015-5-8 16:45:00
9#
回复 8楼IvanBy的帖子

你好。
Spread studio套包里的spreadjs目前是最新版。
spreadjs目前的最新版是Spread Studio 8 SP1。
有关spread studio新增spreadjs前端html5表格控件的信息,请参考官网:
http://www.gcpowertools.com.cn/p ... studio.htm#whatsnew

你可以下载spread studio套包,里面的spreadjs是最新版,下载链接:
http://www.gcpowertools.com.cn/products/download.aspx?pid=46

spreadjs的问题依然可以在此版本反馈。
如果我们论坛有新的版块分割,我们会在论坛通知。
有关新版本的发布和更新功能情况,发布前会在官网进行通知。
请点击评分,对我的服务做出评价!  5分为非常满意!

葡萄城控件服务团队

官方网站: http://www.gcpowertools.com.cn
回复 使用道具 举报
IvanBy
金牌服务用户   /  发表于:2015-5-11 14:04:00
10#
回复 9楼Alice的帖子

:~那现在那个问题有没有解决的
回复 使用道具 举报
12下一页
您需要登录后才可以回帖 登录 | 立即注册
返回顶部