allow pressing enter in ObjectGrids to edit a field

for this we need to overwrite the 'run_editor' function
of the ObjectGrid if we use a custom one

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
This commit is contained in:
Dominik Csapak 2018-04-06 13:22:44 +02:00 committed by Dietmar Maurer
parent 5d3089cd94
commit 9307eda498
3 changed files with 10 additions and 0 deletions

View File

@ -224,6 +224,14 @@ Ext.define('Proxmox.grid.ObjectGrid', {
return value;
},
listeners: {
itemkeyup: function(view, record, item, index, e) {
if (e.getKey() === e.ENTER) {
this.run_editor();
}
}
},
initComponent : function() {
var me = this;

View File

@ -20,6 +20,7 @@ Ext.define('Proxmox.node.DNSView', {
url: "/api2/json/nodes/" + me.nodename + "/dns",
cwidth1: 130,
interval: 1000,
run_editor: run_editor,
rows: {
search: { header: 'Search domain', required: true },
dns1: { header: gettext('DNS server') + " 1", required: true },

View File

@ -26,6 +26,7 @@ Ext.define('Proxmox.node.TimeView', {
url: "/api2/json/nodes/" + me.nodename + "/time",
cwidth1: 150,
interval: 1000,
run_editor: run_editor,
rows: {
timezone: {
header: gettext('Time zone'),