I have a table with several columns and also a search bar at the top that performs the function below. I thought that given the code below, only the "field1" column would be searched, but in fact if I search for a term in another column it will show up. Now my problem is there is a new column I'm adding that I'd like to add to this search. I try adding it to the filters array like this
new filter("fieldIWant",FilterOperator.Contains,sValue)
but it won't work. I made the column invisible because I don't want it displayed on the table but I want it to still be searchable. I guess my first question is why the search bar works for multiple fields when I only specified "field1".
onSearchPressed : function() {
var sValue = this.byId("searchField").getValue();
var aFilters = [];
var filters = [new Filter("field1","EQ",sValue)];
aFilters = filters;
var oFilter = new Filter({aFilters : filters});
if (!aFilters) {
aFilters = [];
}
this._aSearchFilters = aFilters;
if (this._aSelectFilters) {
aFilters = aFilters.concat(this._aSelectFilters);
}
if (this._aQuickFilters) {
aFilters =aFilters.concat(this._aQuickFilters);
}
var oBinding = this.byId("catalogTable").getBinding("items");
oBinding.filter(aFilters );
},
NOTE: This was prewritten code and isn't mine so I don't want to make any major changes but rather understand why it works like it does. _aSelectFilters and _aQuickFilters do not contain any searches for columns, they're for something else.