From: xhaggi Date: Fri, 5 Sep 2014 14:30:55 +0000 (+0200) Subject: [webui] enable any match mode for combo boxes X-Git-Tag: v4.1~1434 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a4d4d24099bcc4308c11fe15abe3a100142fcc69;p=thirdparty%2Ftvheadend.git [webui] enable any match mode for combo boxes This enables the any match mode for combo boxes in the idnode.js which fix the issue that you can't search only for a service name within the service combo box. --- diff --git a/src/webui/static/app/idnode.js b/src/webui/static/app/idnode.js index a05186276..3f269bcc0 100644 --- a/src/webui/static/app/idnode.js +++ b/src/webui/static/app/idnode.js @@ -417,6 +417,50 @@ tvheadend.idnode_editor_field = function(f, create) }; st.on('load', fn); } + + // any match mode + r.doQuery = function(q, forceAll){ + q = Ext.isEmpty(q) ? '' : q; + var qe = { + query: q, + forceAll: forceAll, + combo: this, + cancel:false + }; + + if (this.fireEvent('beforequery', qe) === false || qe.cancel) + return false; + + q = qe.query; + forceAll = qe.forceAll; + if (forceAll === true || (q.length >= this.minChars)) { + if (this.lastQuery !== q) { + this.lastQuery = q; + if (this.mode == 'local') { + this.selectedIndex = -1; + if (forceAll) { + this.store.clearFilter(); + } + else { + this.store.filter(this.displayField, q, true); // supply the anyMatch option + } + this.onLoad(); + } + else { + this.store.baseParams[this.queryParam] = q; + this.store.load({ + params: this.getParams(q) + }); + this.expand(); + } + } + else { + this.selectedIndex = -1; + this.onLoad(); + } + } + }; + return r; /* TODO: listeners for regexp? listeners : {