您是说在点击combo单元格进入编辑状态时候再更新item?
参考如下代码,根据您的需求调整下逻辑
- var firstLoad = true;
- spread.bind(GC.Spread.Sheets.Events.EditStarting, function(s, e){
- var sheet = e.sheet, row = e.row, col = e.col, cellType = sheet.getCellType(row, col);
- if(firstLoad && cellType instanceof GC.Spread.Sheets.CellTypes.ComboBox){
- e.cancel = true;
- firstLoad = false;
- setTimeout(function(){
- cellType.items([2,2,3,2]);
- sheet.startEdit();
- }, 0);
- }
- });
复制代码 |