I use the script like 'ex1' but it will very slow when the event is too much,so I want use pushDestroy to remove events from another datasource like 'ex2' but not useful
ex1:
function remove(ownerId){
var raw = $("#scheduler").data("kendoScheduler").dataSource.data();
var length = raw.length;
var item, i;
for(i=length-1; i>=0; i--){
item = raw[i];
if (item.ownerId==ownerId)
{ $("#scheduler").data("kendoScheduler").dataSource.remove(item); }
}
}
ex2:
var sharableDataSource = new kendo.data.SchedulerDataSource({
transport: {
read: {
url: "/api/tasks",
data: { id: id }
}
},
schema: {
model: {
id: "TaskID",
fields: {
eventID: { from: "EventID" },
taskID: { from: "TaskID" },
title: { from: "Title", validation: { required: true } },
location: { from: "Location" },
start: { type: "date", from: "Start" },
end: { type: "date", from: "End" },
description: { from: "Description" },
recurrenceId: { from: "RecurrenceID" },
recurrenceRule: { from: "RecurrenceRule" },
recurrenceException: { from: "RecurrenceException" },
ownerId: { from: "OwnerID"},
isAllDay: { type: "boolean", from: "IsAllDay" },
alert: { from: "Alert", type: "object", defaultValue: "" },
showfor: { from: "Showfor", type: "object", defaultValue: "busy" },
}
}
}
});
$("#scheduler").data("kendoScheduler").dataSource.pushDestroy(sharableDataSource.data().toJSON());