I have a reactive-table with custom filter defined on a date column
Template.displayoptions.created = function () {
this.timeFilter = new ReactiveTable.Filter('time-filter', ['deadline']);
};
Template.displayoptions.events({
'click .form-check-input'(event,template) {
var timefilter = template.find('#timefilter:checked').value;
var today = new Date();
var thisweek = new Date(moment(today).add(7, 'days'));
var thismonth = new Date(moment(today).add(1, 'month'));
switch(timefilter){
case "today":
template.timeFilter.set({"$gte": today});
break;
case "thisweek":
template.timeFilter.set({"$and":[{"$gte": today}, {"$lt" : thisweek}]});
break;
case "thismonth":
template.timeFilter.set({"$and":[{"$gte": today}, {"$lt" : thismonth}]});
break;
}
}
});
When the event is triggered (radio button to select today/week/month), the table flashes but data remains unchanged.
What could be missing?
rowsPerPage: 5,
filters: ['time-filter'],
showNavigationRowsPerPage: false,
showFilter: false
I have a reactive-table with custom filter defined on a date column
When the event is triggered (radio button to select today/week/month), the table flashes but data remains unchanged.
What could be missing?