Skip to content

Commit

Permalink
#6139table.plugin.CellEditing: onEditorKeyEnter()
Browse files Browse the repository at this point in the history
  • Loading branch information
tobiu committed Dec 16, 2024
1 parent 0d5350d commit 5d064fa
Showing 1 changed file with 23 additions and 2 deletions.
25 changes: 23 additions & 2 deletions src/table/plugin/CellEditing.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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()];
Expand All @@ -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);

0 comments on commit 5d064fa

Please sign in to comment.