本帖最后由 Fiooona 于 2020-4-14 11:53 编辑
监听DragDropBlock事件: 当整列选中时取消执行这个行为,再用moveTo来实现:- sheet.bind(GC.Spread.Sheets.Events.DragDropBlock, function(e,args){
- var range = sheet.getSelections();
- console.log("From Column:" + args.fromCol);
- console.log("From Row:" + args.fromRow);
- console.log("To Column:" + args.toCol);
- console.log("To Row:" + args.toRow);
- // debugger
- if(args.fromRow == -1 && args.toRow == -1){
- args.cancel =true;
- sheet.moveTo(0, args.fromCol, 0, args.toCol, args.rowCount, args.colCount, GC.Spread.Sheets.CopyToOptions.all);
- }
- });
复制代码
|