您好,参考下列代码:
- var spread = GC.Spread.Sheets.findControl("ss");
- var sheet = spread.getActiveSheet();
- sheet.bind(GC.Spread.Sheets.Events.DragFillBlock, function (sender, args) {
- var sheet = args.sheet;
- var sels = sheet.getSelections();
- if(sels && sels.length > 0){
- console.log(sheet.getValue(sels[0].row, sels[0].col));
- }
- args.cancel = true;
- // 这是填充范围
- var fillRange = args.fillRange;
- // 可以自行给fileRange中填写值
- // 这个参数是填充方向,可以判断用户是向上下左右哪个方向拖拽的
- var fillDirection = args.fillDirection;
- // https://demo.grapecity.com.cn/spreadjs/help/v12/content/webframe.html#SpreadJS~GC.Spread.Sheets.Fill.FillDirection.html
- });
复制代码 |