If you want to do this client-side, I'd suggest using something like lo-dash's filter method (or, depending on the browsers you need to support, simply the native Array.filter implementation) to implement your filter.
You could store all data in an external array and only keep the filtered data in the data source which is bound to the UI (update with dataSource.data()
):
var data = [{
name: 'barney',
age: 36,
start: new Date(2011, 1, 1),
end: new Date(2012, 1, 1)
}, {
name: 'fred',
age: 40,
start: new Date(2011, 1, 1),
end: new Date(2010, 1, 1)
}];
var filtered = _.filter(data, function (item) {
return item.start > item.end;
});
dataSource.data(filtered);