I'm not sure what happened to my other reply, it apparently got flagged as spam or something
So I have been trying all sorts of ideas to get the parameterMap to work.. I have had some limited success
$(
"#calendar"
).kendoScheduler({
batch:
false
,
height: 600,
views: [
"day"
,
"week"
,
{ type:
"month"
, selected:
true
},
"agenda"
],
dataSource: {
transport: {
create: {
dataType:
"jsonp"
},
read: {
url: BaseAPI +
"/NewFullCalendar"
,
dataType:
"json"
},
update: {
dataType:
"jsonp"
},
destroy: {
type:
"delete"
,
url: BaseAPI +
"/Calendar"
,
datatype:
"json"
,
},
parameterMap:
function
(options, operation) {
if
(operation ==
"create"
) { alert(
'ive been created'
);
return
{ location: locationID }; }
if
(operation ==
"read"
) { alert(
'Ive been read'
);
return
{ location: locationID }; }
if
(operation ==
"update"
) { alert(
'ive been updated'
);
return
kendo.stringify({ location: locationID, ID: options.models[0].id }); }
if
(operation ==
"destroy"
) { alert(
'ive been destroyed'
);
return
kendo.stringify({ location: locationID, ID: options.models[0].id }); }
}
},
schema: {
model: {
id:
"id"
,
fields: {
ID: { 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:
"Content"
},
recurrenceId: { from:
"recurrenceID"
},
recurrenceRule: { from:
"recurrenceRule"
},
recurrenceException: { from:
"recurrenceException"
},
isAllDay: { type:
"boolean"
, from:
"IsAllDay"
}
}
}
}
}
});
when I run this on our test site, once the database is hit with the read method, you see an alert that it was indeed red.. but once I hit delete on the item, and confirm... it alerts that it was created.. so it SEEMS to hit create..So, maybe some help here would be excellent.
What I am needing to do is send a global variable in (locationID), which is needed for our controllers (webapi) to know what data base to use/ naturally I would also need to get other information:
destroy needs to know what database to use, AND what eventID to delete.
Create needs to know what database to use, and a host of other data
update needs to know what database to use, what ID we are looking at, and what data to change
read only needs to know what database to use.