а

How to reset the events in scheduler


#1

Hi
i am filtering the events using below functions,
scheduler.filter_timeline = function(id, event){
//some_other code
}
scheduler.filter_week = function(id, event){
if(event.name == ‘New event’)
return false; // event will be filtered (not rendered)
//or
return true; // event will be rendered
}
scheduler.filter_day = scheduler.filter_week = function(id, event){
//some_code
}
i am using below code to reset the applied filters on events , its working find but when i do the filter again, filtering is not working

scheduler.filter_timeline = function(id, event){
return true;
}
scheduler.filter_week = function(id, event){
return true;
}
scheduler.filter_day = scheduler.filter_week = function(id, event){
/ return true;
}


#2

Hello @SreedharLenkalapally

Please check this sample that demonstrates how the filtering functionality works
https://docs.dhtmlx.com/scheduler/samples/09_api/09_filtering_events.html

To solve the issue, you don’t need to reset filters in the way you mentioned, i.e. create 2 filtering functions.
You should add conditions to the only function.

scheduler.filter_month = function(id, event) {
				// display event only if its type is set to true in filters obj
				// or it was not defined yet - for newly created event
				if (filters[event.type] || event.type==scheduler.undefined) {
                                        //add the custom logic here
					return true;
				}

				// default, display all events
				return true;
			};

If that doesn’t help you to solve the issue - please share the demo where the issue can be reproduced.