From 8f630c29845198d1510b04d351a51573b7f489d1 Mon Sep 17 00:00:00 2001 From: Dietmar Maurer Date: Thu, 27 Oct 2011 09:42:46 +0200 Subject: [PATCH] ComboGrid.js: allow to select empty value --- www/manager/form/ComboGrid.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/www/manager/form/ComboGrid.js b/www/manager/form/ComboGrid.js index 3719a3f4..4ec48b16 100644 --- a/www/manager/form/ComboGrid.js +++ b/www/manager/form/ComboGrid.js @@ -13,6 +13,20 @@ Ext.define('PVE.form.ComboGrid', { return (count > 10) ? 10*lh : 26+count*lh; }, + // hack: allow to select empty value + // seems extjs does not allow that when 'editable == false' + onKeyUp: function(e, t) { + var me = this; + var key = e.getKey(); + + if (!me.editable && me.allowBlank && !me.multiSelect && + (key == e.BACKSPACE || key == e.DELETE)) { + me.setValue(''); + } + + me.callParent(arguments); + }, + // copied from ComboBox createPicker: function() { var me = this,