Hi,
unfortunately there is no built-in way for accessing timespan elements by id, nor for assigning an id to one.
The closest possible thing is to inject a custom element into HTML of the timespan, and assign an id to it.
Then you’ll be able to access the marked timespan as a parent element of the injected item:[code]scheduler.TimeSpans.Add(new DHXMarkTime()
{
StartDate = “”,
EndDate = “”,
CssClass = “schedule”,
HTML = "Available ",
Id = 1
});
//JS:
var timespan = document.getElementById(‘some_id’).parentNode;[/code]
However, if you’re going to modify or attach events to the marked timespans from a custom code, there would be a certain difficulties.
Marked timspans, as well as the rest of calendar data, can be repainted when it is necessary for the component. That means that old elements will be removed and new one placed instead.
When it happens, all external changes and events attached to timespan element will be lost.
The possible way to solve it, is to delegate event to an element that won’t be re-rendered (.dhx_cal_data), or to use API events provided by the component docs.dhtmlx.com/scheduler/api__s … event.html