I think I've found the problem. The configuration of the SchedulerDataSource is slightly counter-intuitive.
My database stores the ID of events as id
but the Scheduler requires taskId
, so in the schema that field is defined like:
taskId: { from: 'id', type: 'number' }
but I didn't realise you also had to define the model id
as taskId
rather than what's actually returned by the server.
So the complete SchedulerDataSource schema looks like:
schema: {
data: 'data',
total: 'total',
model: {
id: 'taskId',
fields: {
taskId: { from: 'id', type: 'number' },
title: { from: 'title', defaultValue: 'No title', validation: { required: true } },
start: { type: 'date', from: 'start' },
end: { type: 'date', from: 'end' },
description: { from: 'description' },
ownerId: { from: 'employee_id' },
isAllDay: { type: 'boolean', from: "allDay" },
type_id: { type: 'number' }
}
}
}
Just out of interest, does anybody know you can define field 'aliases' using from: 'server-field'
in a regular Kendo DataSource? Could be useful.