你好,默认情况下,FlexGrid会检查setCellData的数据类型,这导致了设置空值时失败,
可以用setCellData的后两个参数来跳出此限制,参考API:
https://demo.grapecity.com.cn/wi ... id.html#setcelldata
具体代码:
- if (saveEdits) {
- if (!wijmo.isUndefined(ctl['selectedItem'])) {
- this._grid.setCellData(this._rng.row, this._rng.col, ctl['selectedItem'], false, false);
- } else
- if (!wijmo.isUndefined(ctl['value'])) {
- this._grid.setCellData(this._rng.row, this._rng.col, ctl['value']);
- } else if (!wijmo.isUndefined(ctl['text'])) {
- this._grid.setCellData(this._rng.row, this._rng.col, ctl['text']);
- } else {
- throw 'Can\'t get editor value/text...';
- }
- this._grid.invalidate();
- } // close editor and remove it from the DOM
复制代码
修改添加位置:
src/CustomGridEditor.js 第281行
如图:
|