From ce9a0f27cd87c2f71183d9b8a89ae7dbf2ff199f Mon Sep 17 00:00:00 2001 From: Dominik Csapak Date: Wed, 2 May 2018 15:28:26 +0200 Subject: [PATCH] save index on keydown and check on keyup so that the edit window does not open again when pressing enter Signed-off-by: Dominik Csapak --- grid/ObjectGrid.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/grid/ObjectGrid.js b/grid/ObjectGrid.js index 68937ce..36c873c 100644 --- a/grid/ObjectGrid.js +++ b/grid/ObjectGrid.js @@ -225,10 +225,17 @@ Ext.define('Proxmox.grid.ObjectGrid', { }, listeners: { - itemkeyup: function(view, record, item, index, e) { + itemkeydown: function(view, record, item, index, e) { if (e.getKey() === e.ENTER) { + this.pressedIndex = index; + } + }, + itemkeyup: function(view, record, item, index, e) { + if (e.getKey() === e.ENTER && index == this.pressedIndex) { this.run_editor(); } + + this.pressedIndex = undefined; } },