Hello,
We are evaluating the scheduler for our project, but we have stumbled probklems doing something I expected to be pretty straight forward.
We need to load new data and refresh the scheduler based on two events:
- The user clicks Prev/Next
- The user changes a selection in an pulldown on the page (external from scheduler)
We are using knockout to trigger a function when
- An observable is changed from the onBeforeViewChange handler
- An observable is changed from the external select/dropdown
In both cases we call a function:
var reload = function (newValue) {
// Get date from view model
var lastDate = schedulerModelInstance.lastDate();
$.ajax({
url: "../Fravar/GetLessonsForResource",
data: {
dateFrom: lastDate.toISOString(),
days: schedulerModelInstance.days,
resourceType: schedulerModelInstance.selectedResourceType(),
resourceId: schedulerModelInstance.selectedResourceId(),
},
success: function(data) {
scheduler.parse(data, "json");
scheduler.updateView();
},
dataType: "text"
});
};
This does not work. No error messages, and no new events in the scheduler. I have verified that the data we get in the ajax call looks ok.
"[{"id":"1","text":"Gruppe ENG001","start_date":"2013-08-09 09:00:00","end_date":"2013-08-09 09:45:00"},{"id":"2","text":"Gruppe MAT009","start_date":"2013-08-09 10:00:00","end_date":"2013-08-09 10:45:00"},{"id":"3","text":"Gruppe NOR002","start_date":"2013-08-09 10:00:00","end_date":"2013-08-09 10:45:00"}]"
We have also tried parsing the result of $.getJSON(), or using scheduler.load(customUrl). Same result (no new events and no errors), even though the data on the wire looks ok.
Any and all help to make this work is greatly appreciated as right now we are dead in the water.
–
Thor Arne Johansen
Oppad AS