diff --git a/src/table/plugin/CellEditing.mjs b/src/table/plugin/CellEditing.mjs index 87564b451..4d8a9a552 100644 --- a/src/table/plugin/CellEditing.mjs +++ b/src/table/plugin/CellEditing.mjs @@ -54,13 +54,23 @@ class CellEditing extends Plugin { me.editors[dataField] = editor = Neo.create({ module : TextField, appName : me.appName, + dataField, hideLabel: true, parentId : view.id, + record, value : record[dataField], - windowId : me.windowId + windowId : me.windowId, + + keys: { + Enter: me.onEditorKeyEnter.bind(me) + } }) } else { - editor.setSilent({value: record[dataField]}) + editor.setSilent({ + dataField, + record, + value: record[dataField] + }) } cellNode.cn = [editor.createVdomReference()]; @@ -72,6 +82,17 @@ class CellEditing extends Plugin { editor.focus() }) } + + /** + * + * @param {Object} path + * @param {Neo.form.field.Base} field + */ + onEditorKeyEnter(path, field) { + if (field.isValid()) { + field.record[field.dataField] = field.value + } + } } export default Neo.setupClass(CellEditing);