fix: wrap style in drop column.

fix: also change `DisplayValue` after changed.
feature: support uncompressed export.
change: add `editing` parameter in GridColumn.setEnabled.
This commit is contained in:
2024-03-08 17:26:38 +08:00
parent 70ab06190f
commit f54eb3ac24
4 changed files with 112 additions and 41 deletions

View File

@ -140,6 +140,7 @@ export class GridColumn {
* 设置单元格可用性时调用的方法
* @param {HTMLElement} element - 单元格元素
* @param {boolean} enabled - 启用值,为 `false` 时代表禁用
* @param {boolean} editing - 是否处于编辑状态
* @virtual
*/
static setEnabled(element, enabled) {
@ -190,6 +191,9 @@ export class GridColumn {
}
if (hasValue) {
val.Value = value;
if (Object.prototype.hasOwnProperty.call(val, 'DisplayValue')) {
val.DisplayValue = value;
}
} else {
wrapper.values[key] = value;
}
@ -478,7 +482,10 @@ export class GridDropdownColumn extends GridColumn {
* @returns {any}
*/
static getValue(e, col) {
return e[col.dropOptions?.valueKey ?? 'value'];
return {
value: e[col.dropOptions?.valueKey ?? 'value'],
text: e[col.dropOptions?.textKey ?? 'text']
};
}
/**