This is a migrated thread and some comments may be shown as answers.

Clear filtering from scheduler?

2 Answers 79 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Aron
Top achievements
Rank 1
Aron asked on 02 Oct 2015, 06:54 AM
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
01.function onSelectRoom(e) {
02. 
03.    var roomObjId = $("#ddlObjects").data("kendoDropDownList").dataItem();
04.    var operator1 = "eq";
05.    var logic1 = "or";
06.    var scheduler = $("#scheduler").data("kendoScheduler");
07. 
08.    if (roomObjId.ObjectID < 1) {
09.        //Clear the filtering
10.    }
11.    var selectedObj = [roomObjId.ObjectID];
12. 
13.    var filter = {
14.        logic: logic1,
15.        filters: $.map(selectedObj, function (value) {
16.            return {
17.                operator: operator1,
18.                field: "Id",
19.                value: value
20.            };
21.        })
22.    };
23. 
24. 
25. 
26.    scheduler.dataSource.filter(filter);
27.}

The code above works for filtering, however i need to clear the filtering if the objectID is < 0. Is there any method such as

scheduler.dataSource.clearFilter(); ? 

Thanks.

 

2 Answers, 1 is accepted

Sort by
0
Accepted
Tim Fargo
Top achievements
Rank 1
answered on 02 Oct 2015, 11:35 PM

Hey Aron,

 You should just be able to do:

scheduler.dataSource.filter([]);

0
Aron
Top achievements
Rank 1
answered on 05 Oct 2015, 06:24 AM
This worked. Thanks!
Tags
Scheduler
Asked by
Aron
Top achievements
Rank 1
Answers by
Tim Fargo
Top achievements
Rank 1
Aron
Top achievements
Rank 1
Share this question
or