search envelope-o feed check
Home Unanswered Active Tags New Question
user comment-o

Uncaught Error: Event data item must specify 'start' property

Asked by Er Prajkta
4 years ago.

I am working on scheduler in that i want to select date by using using navigator.i want to assign selected date of navigator to scheduler .When i click on day of navigator am getting error like "Uncaught Error: Event data item must specify 'start' property". Please help me I am searching solution for this error from last 2 days but i am not getting any clue about this.I am not getting why this error occured.The code i wrote for navigoter is as follow:

var nav = new DayPilot.Navigator("nav", {
                selectMode: "day",
                onBeforeCellRender: function (args) {
                    if (args.cell.day < DayPilot.Date.today()) {
                        args.cell.cssClass = "navigator-disabled-cell";
                    }
                },
                onTimeRangeSelect: function (args) {
                    if (args.day < DayPilot.Date.today()) {
                       // args.preventDefault();
                        nav.select(lastDate, { dontNotify: true, dontFocus: true });
                    }
                    else {
                        lastDate = args.start;
                    }
                },
                onTimeRangeSelected: function (args) {
                    console.log("nav args");
                    console.log(args);
                    dp.startDate = args.start;
                    //var temp = (args.start).toString().replace("T00:00:00","T00:00:00.000");
                  
                    //dp.startDate = temp;
                    dp.days = args.days;
                    dp.update();
                }
            });
            nav.init();

Please help me .

Answer posted by Dan Letecky [DayPilot]
4 years ago.

You need to check the Scheduler event data (dp.events.list). The data items must use the structure described here:

https://api.daypilot.org/daypilot-event-data/

This error suggests that the data item structure is not correct - at least the "start" property is missing.

Comment posted by Er Prajkta
4 years ago.

I am binding events to scheduler using below thehnique.Everything is working fine except navigater.Please help me sir

// generate and load events
$.ajax({
type: "POST",
url: "/Scheduler/GetEvents",
dataType: "json",
success: function (responsex) {
events = [];
var response = JSON.parse(responsex);
//$.each(data, function (i, v) {
for (var i = 0; i < response.length; i++) {

var e = new DayPilot.Event({
start: response[i].start,
end: response[i].end,
//id: DayPilot.guid(),
id: response[i].Id,
resource: response[i].resource,
text: response[i].text,
backColor: response[i].BackColor,
description: response[i].Description

/*,
bubbleHtml: "Testing bubble"*/
});
dp.events.add(e);
// console.log("Event Add");
//console.log(e);
}
},
error: function (error) {
alert('failed');
}
})

This question is more than 1 months old and has been closed. Please create a new question if you have anything to add.