Below I am filtering by a single property sure, but how do I filter by another one in one go? That is, without providing the user with a drop down containing different search options Example: My search term maybe name, email or age.
var search = this.controllerFor('employees').search; //can be name, email or age
employees = this.get('currentModel').filterProperty('name', search);
The above works fine for updating the master list but I am only able to filter by one property at a time.
//Sample Model
App.Employee = DS.Model.extend({
email: DS.attr('string'),
name: DS.attr('string'),
age: DS.attr('number'),
})
One thought is to re-filter again if the filter results length = 0
and some how merge the results. However, I am not big on that idea and believe Ember may have a better - more elegant way of achieving this.