onSchedulerReady bug?

Hello,

I am having trouble with this method. I’ve redone the complete nav in responsive bootstrap so that it works well on mobile and smaller screens as well. So I had to remap/rebind all the buttons and adptative texts.

My problem is this :

On view change works for setting the date at the top of the page :

scheduler.attachEvent("onViewChange", function(){ var state = scheduler.getState(); var date_to_str = scheduler.templates[state.mode + "_date"]; $("#navtextdate").html(date_to_str(state.min_date, state.max_date, state.mode)); });

But it doesn’t work the first time the page is loaded unfortunately. So I tried adding this

scheduler.attachEvent("onSchedulerReady", function() { state = scheduler.getState(); var date_to_str = scheduler.templates[state.mode + "_date"]; $("#navtextdate").html(date_to_str(state.min_date, state.max_date, state.mode)); })

But it doesn’t work and I don’t don’t know why. I’ve tried putting a breakpoint at that place and using the console. When I do scheduler.getState() it works well but when I press step into it sends me to

dhtmlx.alert = function(){ var text = box_params.apply(this, arguments); text.type = text.type || "confirm"; return alertPopup(text); };

in the codebase. There’s no Javascript error and I’ve searched for a while now. If someone can help that’d be appreciated.

Hello,
make sure you attaching these events before scheduler.init is called. onViewChange is called for the first render
docs.dhtmlx.com/scheduler/snippet/60451c51