Ext.NET 4.8 Cell Editing Plugin: Prevent Enter Key from Unfocusing Editor
To prevent the Enter key from unfocusing the editor in the Cell Editing plugin in Ext.NET 4.8, you can use the 'completeOnEnter' property of the Cell Editing plugin and set it to 'false'.
Here's an example of how you can achieve this:
<ext:GridPanel runat="server" ID="GridPanel1">
<Store>
<ext:Store runat="server">
<!-- store configuration -->
</ext:Store>
</Store>
<Plugins>
<ext:CellEditing runat="server" ID="CellEditing1">
<Listeners>
<BeforeComplete Handler="if (e.getKey() === Ext.EventObject.ENTER) { e.cancel = true; }" />
</Listeners>
</ext:CellEditing>
</Plugins>
<ColumnModel>
<!-- column model configuration -->
</ColumnModel>
</ext:GridPanel>
In the above example, the 'completeOnEnter' property is set to 'false' by default, preventing the Enter key from unfocusing the editor. Additionally, a 'BeforeComplete' listener is added to the Cell Editing plugin to cancel the editing action when the Enter key is pressed.
This way, the editor will stay focused even after pressing the Enter key.
原文地址: https://www.cveoy.top/t/topic/qpr7 著作权归作者所有。请勿转载和采集!