I'm creating a ComboBox with Groupings (ie Country/City) values. I was able to create the grouping by defining a template that works well. The filtering works well of the City values, but I want to filter on Country OR City. (Country is the grouping). Now, I'm trying to customize the filtering of the store on records where query value matches the City OR the Country.

My first attempt was to add a handler for the beforeQuery event on the ComboBox, but I had to copy some of the logic from the doQuery function into my handler.

My current solution is to wrap the filter function from my store in a function that alters the parameters passed in from my ComboBox.

// wrap the original filter function around a function which catches the query
// and alters it to look in country or city columns
ds.baseFilter = ds.filter;
ds.filter = function (property, value, anyMatch, caseSensitive, exactMatch) {

if (typeof property == 'string') { // check if the property is a string
// assume that this is combo box and search on City OR Country