Search code examples
javascriptschedulerdhtmlx

DHTMLX Scheduler: Add event to section


I have this scheduler with sections. https://snag.gy/r96y1c.jpg

I am using a custom popup to add events to this section and my current config when i click add on the popup is this:

scheduler.addEvent({
    start_date: newDate,
    end_date:   newEndDate,
    text: "Booking",
    sections: { unit: MessageRoom }
});

where MessageRoom is the number of the section.

I even change the config to have room option too but the event always add to the first section.

What I am doing wrong?

Regards.


Solution

  • You need to specify a value for a property that is mapped to units view section ('section_id', or another property depending on your config). If you do so, event will be created in the specified section.

    scheduler.addEvent({
        start_date: new Date(2017,5,30,3),
        end_date:   new Date(2017,5,30,8),
        text: "Booking",
        section_id: 3
    });
    

    Snippet how it works