Add marked time span from client side does not work

It works from server side:
sched.TimeSpans.Add(new DHXMarkTime() {
Day = DayOfWeek.Monday,
CssClass = “event-HoraComer”, HTML = “”,
Zones = new List() { new Zone { Start = 14 * 60, End = 16 * 60 } },
SpanType = DHXMarkTime.Type.Default
});

but, it doesn’t from client side:
scheduler.addMarkedTimespan({
days: 1
, zones: [14 * 60, 16 * 60]
, css: “event - HoraComer”
, type: “default”
});

Hi,
timespans added via ‘addMarkedTimespan’ won’t be visible until you refresh the scheduler

scheduler.addMarkedTimespan({ days: 1 , zones: [14 * 60, 16 * 60] , css: "event - HoraComer" , type: "default" }); scheduler.setCurrentView();

Thank you

I supossed it would work, but it doesn’t.

It only works when set type to dhx_time_block

, type: “dhx_time_block”

It doesn’t work if set type to default.

Did you define css class for the marked timespan?
I’ve just checked on the local example - timespan is added and rendered. Without any css settings it is transparent, since the default type do not have predefined style(but you still can find it with a DOM inspector). If you add css setting for bg color or border - timespan will be shown

Sorry but I do not understand,

css is “event-HoraComer” and is set in cssCass property, CssClass = “event-HoraComer”

I understand than “default” is a type, not a css class. Anyway I’ve created class .default but it doesn’t work, I do not see any div with .default class rendered.

I think I am confuse with it, if I set type “dhx_time_block”, it renders the time block, but lock it, and I want to render a time block with an spcific css (“event-HoraComer”) but no to lock the time, so I readed in documentation I’ve to set property type to “default”, but it do nothing. Also I do not understand relation between properties cssclass and type. type property it’s not documented.

Hello,
In the code from your first post, css class of client-side timespan is defined as “event - HoraComer” (whitespaces around the dash). Maybe you’ve specified wrong class in configuration.

I’ve tried with following code:
CSS:

.event-HoraComer{ background-color: red; }JS:

[code]scheduler.init(‘scheduler_here’,new Date(),“week”);

scheduler.addMarkedTimespan({
days: 1
, zones: [14 * 60, 16 * 60]
, css: “event-HoraComer”
, type: “default”
});
scheduler.setCurrentView();[/code]
And timespan was displayed properly. If you have different result - please attach a demo.

Thats correct, ‘type’ is added to have a possibility to create logically different types of timespans (you can check if particular event overlaps timespan of the particular type docs.dhtmlx.com/scheduler/api__s … espan.html )

There is only type with predefined behavior - “dhx_time_block” - also has predefined css style, thats why it’s visible even if you do not specify custom styles. So if timespan is visible when have ‘dhx_time_block’ type and not visible with other types - that means custom css rules are not attached

It works, the mistake was in blank spaces of css class.

Thank you and excuse me

Hi

But this css working in ff and chrome,but ie not working,please give me some light regarding issue.