Multi Filtering

Hello!

I will try use filtering in scheduler but it’s not working for me :frowning:

I have json file to import in scheduler - work excelent.

But I need filtering by training name and instructor name but this does’t work together.

Sample JSON:

start_date: "2015-09-01 14:00", end_date: "2015-09-01 15:00", text:"Fitness for woman", tt: "fit_training", filt:"john doe"
scheduler.filter_month = scheduler.filter_day = scheduler.filter_week = function(id, event) {
				if (filters[event.filt] || event.filt==scheduler.undefined) {
					return true;
				}				
				
				if (filters[event.tt] || event.tt==scheduler.undefined) {
					return true;
				}
			};

Hi,
your filter returns ‘true’ if the event meets the first condition, without the second checking one in that case

if (filters[event.filt] || event.filt==scheduler.undefined) { return true; }
So it works as ‘OR’ - event will be shown if it pass the first or the second checking
If you want it to work as ‘AND’ - event will be shown if it pass both the first and the second checking, you need to implement it accordingly,
the simplest way would be just invert checkings;[code]scheduler.filter_month = scheduler.filter_day = scheduler.filter_week = function(id, event) {
if (!(filters[event.filt] || event.filt==scheduler.undefined)) {
return false;
}

        if (!(filters[event.tt] || event.tt==scheduler.undefined)) {
           return false;
        }
return true;

};[/code]