Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[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.
  • Loading branch information
xhaggi authored and perexg committed Sep 8, 2014
1 parent 52d34e7 commit a4d4d24
Showing 1 changed file with 44 additions and 0 deletions.
44 changes: 44 additions & 0 deletions src/webui/static/app/idnode.js
Expand Up @@ -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 : {
Expand Down

0 comments on commit a4d4d24

Please sign in to comment.