Week-Tab readonly?

Is there a possibility to make only the week-tab readonly ?

I tried

var mode = scheduler.getState().mode;
                    if(mode == "week"){
                        scheduler.config.readonly = true;
                    }

But this variable seems to be initialized too late, no matter where I put this code, it’s always undefined except of after

var dp = new dataProcessor("events.php");
        dp.init(scheduler);

but then it’s too late?!

thanks in advance,
best wishes

You need to place such kind of rule in the event handler

scheduler.attachEvent("onViewChange", function(mode){ scheduler.config.readonly = ( mode == "week" ); });

What do you mean by event handler ? Where do I have to put this ?

by the way, thank you very much for your quick reply

I just put it anywhere in the code and printed out the variable mode. Bizarrely the code is only interpreted on day, month and timeline, not on week.

Ah, Ok, it’s because I have this custom week-view:

scheduler.createTimelineView({
            name: "week",
            x_unit: "day",
            x_date: "%D, %d %M",
            x_step: 1,
            x_size: 7,
            y_unit: sections,
            y_property: "user_id",
            render: "bar",
            event_dy: "full"
        });

and this is also the point why I want to make this readonly, because with this view, unlimited events are created by clicking into a cell.

I want to have a week view with sections on the left, like in the timeline

Names “week”,“month”,“day” are reserved for default 3 views, so it will be better to rename the above timeline view

What do you mean by event handler ?
Scheduler allows to customize its behaviors, by attaching handlers for different actions
docs.dhtmlx.com/scheduler/api__r … vents.html