Just started experimenting with Kendo UI and I'm stuck with how one can use a standard javascript object to use as the datasource.
It's easy enough to initially load the data from the javascript object but I want to be able to get the data back after changes have occurred through user interaction.
Preferably, if this object is somehow synced with the widget, so all one has to do is read/write to this javascript object.
Our data:
var _data = [
{
eventID: 8,
title: Group meeting.,
start: new Date(2013/06/13 07:00),
end: new Date(2013/06/13 08:30),
pending:false,
recurrenceRule: ,
recurrenceException: ,
description: Take my brother to his group meeting.,
isAllDay:false,
ownTimeSlot:true,
careAssistantId: 5,
clientId: 6
},{
eventID: 9,
title: Make dinner.,
start: new Date(2013/06/13 11:00),
end: new Date(2013/06/13 13:30),
pending:true,
recurrenceRule: ,
recurrenceException: ,
description: Make dinner for my mom.,
isAllDay:false,
ownTimeSlot:true,
careAssistantId: 5,
clientId: 6
} ];
Init widget:
function save(){
console.log(_data);
}
$('.schedule').kendoScheduler({
date: new Date(2013/6/13),
startTime: new Date(2013/6/13 07:00 AM),
height: 600,
views: [ { type: week, selected: true }],
save: save,
dataSource:_data
});
Here is the code setup to be tested (note the console.log debug on save):
How is one supposed to read/write the 'state' in the Kendo UI world?