本帖最后由 王炫皓 于 2020-7-23 16:20 编辑
代码如下,给combox设置 items 打开无数据一片空白
let firstLoad = true;
vm.activeSheet.bind(vm.GC.Spread.Sheets.Events.EditStarting, function(s, e){
let sheet = e.sheet, row = e.row, col = e.col, cellType = sheet.getCellType(row, col);
if(firstLoad && cellType instanceof vm.GC.Spread.Sheets.CellTypes.ComboBox){
e.cancel = true;
firstLoad = false;
setTimeout(function(){
let items = new Array;
//获取 关联来源字段值
for(let colIndex = 0 ; colIndex < 10; colIndex++){
items.push({text:colIndex,value:colIndex});
if(items.length == 9){
cellType.items(items);
break;
}
}
sheet.startEdit();
firstLoad = true;
}, 0);
}
});
|