|
|
@@ -780,7 +780,7 @@ const SpreadJsObj = {
|
|
|
if (colSetting.cellType === 'customizeCombo') {
|
|
|
const cellKey = colSetting.cellTypeKey ? 'customizeCombo-' + colSetting.cellTypeKey : 'customizeCombo';
|
|
|
if (!sheet.extendCellType[cellKey]) {
|
|
|
- sheet.extendCellType[cellKey] = this.CellType.getCustomizeComboCellType(colSetting.comboItems);
|
|
|
+ sheet.extendCellType[cellKey] = this.CellType.getCustomizeComboCellType(colSetting.comboItems, colSetting.maxDrop);
|
|
|
SpreadJsObj._addActivePaintEvents(sheet, sheet.extendCellType[cellKey]);
|
|
|
}
|
|
|
sheet.getRange(-1, col, -1, 1).cellType(sheet.extendCellType[cellKey]);
|
|
|
@@ -2536,26 +2536,28 @@ const SpreadJsObj = {
|
|
|
getUnitCellType: function (comboEdit, items = ['m', 'km', 'm2', 'm3', 'dm3', 'kg', 't', 'm3·km',
|
|
|
'总额', '月' ,'项', '处' ,'个', '根', '棵', '块', '台', '系统', '延米', '每一试桩',
|
|
|
'桥长米', '公路公里', '株', '组', '座', '元', '工日', '套', '台班', '辆', '艘班', '亩', '片',
|
|
|
- 'm/处', 'm/道', 'm/座', 'm2/m', 'm3/m', 'm3/处', '根/米', 'm3/m2']) {
|
|
|
+ 'm/处', 'm/道', 'm/座', 'm2/m', 'm3/m', 'm3/处', '根/米', 'm3/m2'], maxDrop) {
|
|
|
let combo = this.getActiveComboCellType();
|
|
|
combo.editable(comboEdit);
|
|
|
combo.itemHeight(10).items(items);
|
|
|
+ if (maxDrop) combo.maxDropDownItems(maxDrop);
|
|
|
return combo;
|
|
|
},
|
|
|
/**
|
|
|
* 获取 自定义的CellType
|
|
|
* @returns {GC.Spread.Sheets.CellTypes.ComboBox}
|
|
|
*/
|
|
|
- getCustomizeComboCellType: function (items) {
|
|
|
+ getCustomizeComboCellType: function (items, maxDrop) {
|
|
|
let combo = this.getActiveComboCellType();
|
|
|
if (typeof items[0] === 'string') {
|
|
|
combo.itemHeight(10).items(items);
|
|
|
} else {
|
|
|
combo.itemHeight(10).editorValueType(spreadNS.CellTypes.EditorValueType.value).items(items);
|
|
|
}
|
|
|
+ if (maxDrop) combo.maxDropDownItems(maxDrop);
|
|
|
return combo;
|
|
|
},
|
|
|
- getSpecComboCellType: function (items) {
|
|
|
+ getSpecComboCellType: function (items, maxDrop) {
|
|
|
const ComboCellType = function () {};
|
|
|
ComboCellType.prototype = new spreadNS.CellTypes.ComboBox();
|
|
|
const proto = ComboCellType.prototype;
|
|
|
@@ -2601,6 +2603,7 @@ const SpreadJsObj = {
|
|
|
};
|
|
|
const combo = new ComboCellType();
|
|
|
combo.itemHeight(10).items(items).editorValueType(spreadNS.CellTypes.EditorValueType.value);
|
|
|
+ if (maxDrop) combo.maxDropDownItems(maxDrop);
|
|
|
return combo;
|
|
|
},
|
|
|
getStageComboCellType: function () {
|
|
|
@@ -2612,6 +2615,7 @@ const SpreadJsObj = {
|
|
|
const col = setting.cols[context.col];
|
|
|
const data = SpreadJsObj.getSelectObject(context.sheet);
|
|
|
this.itemHeight(10).editorValueType(spreadNS.CellTypes.EditorValueType.value).items(col.getItems(data));
|
|
|
+ if (col.maxDrop) combo.maxDropDownItems(col.maxDrop);
|
|
|
};
|
|
|
return new ComboCellType();
|
|
|
},
|