Below I filter one property confidently, but how can I filter another at a time? That is, without providing the user with a drop-down list containing various search parameters Example. My search term can be name, email address or age.
var search = this.controllerFor('employees').search; //can be name, email or age employees = this.get('currentModel').filterProperty('name', search);
The above works great for updating the main list, but I can only filter 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 filter the filter again if the filter result is length = 0 , and the other how to combine the results. However, I am not big on this idea and believe that Amber may be the best - a more elegant way to achieve this.
Kalbb
source share