adding event

hello,
how can i specify section id to the following code ,

scheduler.addEventNow(date, scheduler.date.add(date, event_step, "minute")); 

because i want to add an event dynamically to the units view , the above code doesn’t accept any section_id so the event is adding to the first section in the units view.

please suggest me any other alternate function that full fill my requirement .

thanks

The way you are calling addEventNow doesn’t appear to be correct, see the docs -http://docs.dhtmlx.com/scheduler/api__scheduler_addeventnow.html

addEventNow just accepts an event object which is a standard js object with the properties scheduler requires e.g.

scheduler.addEventNow({
start_date: new Date(2013,0,10,8,30),
end_date: new Date(2013,0,10,10,30),
text: “Meeting”,
holder: “John”, //userdata
room: “5” //userdata
section_id: 1
});

Thank you smartfaceweb it worked :slight_smile:
i changed the code like this

scheduler.addEventNow({ start_date:date, end_date: scheduler.date.add(date, event_step, "minute"), section_id: glblCurrentSectionId });

and now its working fine , once again thanks a lot :slight_smile: