parent.scheduler.addMarkedTimespan

Hi,

I want to update my MarkedTimespan in my scheduler.

If i make it manually in the same page of the sheduler definition it works fine, but if I use it from a child page to the parent, It doesn’t work.
Dialogue between pages is ok because in the same child i upgrade my sheduler by parent.sheduler.parse(s) without any issu.

Here is my code :


parent.scheduler.deleteMarkedTimespan();
     
parent.scheduler.addMarkedTimespan({days: [4],zones: [0*60,7*60],type: "dhx_time_block",invert_zones: false,sections: { court: ["INS000000012","INS000000013","INS000000014","INS000000015"]}});

        parent.scheduler.addMarkedTimespan({days: [4],zones: [12*60,15*60],type: "dhx_time_block",invert_zones: false,sections: { court: ["INS000000012","INS000000013","INS000000014","INS000000015"]}});

        parent.scheduler.addMarkedTimespan({days: [4],zones: [22*60,23.50*60],type: "dhx_time_block",invert_zones: false,sections: { court: ["INS000000012","INS000000013","INS000000014","INS000000015"]}});

 parent.scheduler.updateView();

I haven’t any javascript issue in the browser’s console.

Can you help me please?
Thanks,
Loïc

Hello,

Unfortunately I’m not fully understand what’s happening in your application and when you try to update timespans.

parent.scheduler.updateView();
This method works for the currently active view. If you try to update some specific view when another page is active, it will work only for this active page.

Perhaps this snippet can help you. It is a way to hightlight the days of the week with the alternating colors. In this case “scheduler.deleteMarkedTimespan()” is used when onBeforeViewChange fires. Then (onViewChange event) new markedTimespan is created and called scheduler.updateView().
docs.dhtmlx.com/scheduler/snippet/70272679

If this didn’t help you to solve the issue, please, provide with access to your application or at least with more information or show your code to help us understand the cause of the problem.

Thanks for your answer.

As I understand, we can’t update sheduler’s addmakedtimespan from a child’s iframe.
I did something not very clean but effective… In my child frame I launch a function in the parent, and in parameters I give my code.
The function is like that :

function blockTimeSchedul(code){ scheduler.deleteMarkedTimespan(); eval(code); scheduler.updateView(); }

As I said, not very clean but it did the job…
Thanks for your explanations.

Best regards,
Loïc