- /**
- * 将数据源设置给报表
- */
- setSpreadSource:function(option,callback){
- var self = this;
- var count = self.spread.getSheetCount();
- for(var i=0;i<count;i++){
- var sheet = self.spread.getSheet(i);
- sheet.suspendPaint();
- //传入数据源
- if (typeof(this.option.data) === "object") {
- var source = new GC.Spread.Sheets.Bindings.CellBindingSource(source);
- sheet.setDataSource(source);
- callback();
- }else{
- //远程调用数据源
- this.getDataSource(option,function(data){
- var source = new GC.Spread.Sheets.Bindings.CellBindingSource(data);
- sheet.setDataSource(source);
- callback();
- });
- }
- sheet.resumePaint();
- }
- },
复制代码
这是问题代码,现在通过切换页签事件处理了一下 |