title: Angular Kendo Scheduler Filter
body: <p>I'm using the kendo scheduler here in my project, my angular controller make a call to the server to get data, but when i try to filter the events dynamically, the events don't disapear, does anyone have any suggestions on how I can filter my Scheduler data dynamically? Here is my controller</p>
  
  <pre><code>        $scope.exercises = data.Data;
  
          $scope.result = new kendo.data.ObservableArray([]);
          $scope.transformData = function (response) {
              var event;
              for (var idx = 0, length = response.length; idx &lt; length; idx++) {
                  event = response[idx];
  
                  $scope.result.push(new kendo.data.SchedulerEvent({
                      id: event.TaskID,
                      taskId: event.TaskID,
                      ownerId: event.OwnerID,
                      start: kendo.parseDate(event.start),
                      end: kendo.parseDate(event.end),
                      title: event.Title,
                      description: event.Description,
                      isAllDay: event.IsAllDay
                  }));
              }
          };
  
          $scope.schedulerOptions = {
              showWorkHours: false,
              editable: false,
              views: [
                  "day",
                  "workWeek",
                  "week",
                  {type: "month", selected: true},
              ],
              resources: [
                  {
                      field: "ownerId",
                      title: "Owner",
                      dataSource: [
                          {value: "sazonalidade_padrao", color: "red" },
                          {value: "volumetrica_anual", color: "green" },
                          {value: "flexibilidade_mensal", color: "yellow"},
                          {value: "volumetrica_mensal", color: "orange"}
                      ]
                  }
              ],
              dataSource: {
                  data: $scope.result,
                  filter: {
                      logic: "or",
                      filters: [
                          { field: "ownerId", operator: "eq", value: "sazonalidade_padrao" },
                          { field: "ownerId", operator: "eq", value: "volumetrica_anual" },
                          { field: "ownerId", operator: "eq", value: "flexibilidade_mensal" },
                          { field: "ownerId", operator: "eq", value: "volumetrica_mensal" }
                      ]
                  }
              }
          };
  
  
          $scope.generateObjToScheduler = function() {
              var i = 0;
              var resultado = [];
              angular.forEach($scope.exercises, function (exercise) {
                  if (exercise.Operation.generalStatus == 'aprovado') {
                      i++;
                      var dateStart = moment(exercise.dueDate, 'YYYY-MM-DD').format('x');
                      var dateEnd = moment(exercise.dueDate, 'YYYY-MM-DD').format('x');
                      var response = {
                          "TaskID": i,
                          "OwnerID": exercise.OperationFlexibility.type,
                          "Title": exercise.Operation.code+'-'+exercise.OperationFlexibility.name,
                          "Description": exercise.OperationFlexibility.name,
                          "IsAllDay": true,
                          "start": "/Date(" + dateStart + ")/",
                          "end": "/Date(" + dateEnd + ")/"
                      };
                      resultado.push(response);
                  }
              });
              $scope.transformData(resultado);
          };
          $scope.generateObjToScheduler();
  
          $scope.filterFlexibility = function() {
              $scope.schedulerOptions.dataSource.filter.filters.splice(0,1);
          };
      }
  ]);
  </code></pre>
  
  <p>I fire filterFlexibility function from a checkbox</p>