From 695e706f77cf86d459d9cbd1c5774e827a02b67a Mon Sep 17 00:00:00 2001 From: Adam Sutton Date: Sun, 10 Nov 2013 21:50:46 +0000 Subject: [PATCH] webui: horrible hack to force combobox to reload on store update This shouldn't be necessary but I just can't figure out the right magic runes to make it work properly. --- src/webui/static/app/idnode.js | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/src/webui/static/app/idnode.js b/src/webui/static/app/idnode.js index db451474..46f33648 100644 --- a/src/webui/static/app/idnode.js +++ b/src/webui/static/app/idnode.js @@ -276,21 +276,31 @@ tvheadend.idnode_editor_field = function(f, create) var cons = Ext.form.ComboBox; if (f.list) cons = Ext.ux.form.LovCombo; - return new cons({ + var st = tvheadend.idnode_enum_store(f); + var r = new cons({ fieldLabel : f.caption, name : f.id, value : value, disabled : d, width : 300, - mode : 'local', + mode : 'remote', valueField : 'key', displayField : 'val', - store : tvheadend.idnode_enum_store(f), + store : st, typeAhead : true, // TODO: this does strange things in multi forceSelection : false, triggerAction : 'all', - emptyText :'Select ' + f.caption +' ...' + emptyText :'Select ' + f.caption +' ...', + listeners : { + beforequery: function(qe){ + delete qe.combo.lastQuery; + } + } }); + st.on('load', function() { + r.setValue(r.getValue()); + }); + return r; /* TODO: listeners for regexp? listeners : { keyup: function() {