window.onload = function () {
var spread = new GC.Spread.Sheets.Workbook(document.getElementById("ss"));
var sheet = new GC.Spread.Sheets.Worksheet('New Sheet');
spread.addSheet(0, sheet);
var test = [
{ "Series0": 4, "Series1": 2,"Series2": 4, "Series3": 2 ,"Series4": 2 ,"Series5": 2 },
{ "Series0": 3, "Series1": 4,"Series2": 4, "Series3": 2 ,"Series4": 2 ,"Series5": 2},
{ "Series0": 3, "Series1": 4 ,"Series2": 4, "Series3": 2,"Series4": 2 ,"Series5": 2}
];
var activeSheet = spread.getActiveSheet();//获取工作薄
spread.options.allowUserDragDrop = true;
activeSheet.autoGenerateColumns = true;
activeSheet.setDataSource(test, true);
activeSheet.bind(GC.Spread.Sheets.Events.DragDropBlock, function (e, args) {
//获取下标值
console.log("From Column:" + args.fromCol);
console.log("To Column:" + args.toCol);
//获取拖拽列的列名
var colName = activeSheet.getValue(0, args.fromCol, GC.Spread.Sheets.SheetArea.colHeader);
console.log(colName)
});
}
设置了允许拖动,也绑定了拖动事件,但就是拖动不了列,请问是什么原因 |