Hi, thank you ... still stuck
I call my initDpScheduler() in daTatables .on(); ...this i can't change if page is loaded... because now dataTables working only on ajax and draws only itself by calling on every draw the initDpScheduler()
1. if i want use dp.update() method i have this problem
function initDpScheduler() {
const dp = new DayPilot.Scheduler("dp");
....
dp.init();
dp.update(resource=resourceJS,events=eventsJS);
}
on 2nd redraw of Datatables (2nd init) i got same issue as before: The target placeholder was already initialized by another DayPilot component instance.
If i change order that first is dp.update(resource=resourceJS,events=eventsJS); dp.init();
i got error: You are trying to update a DayPilot.Scheduler object that hasn't been initialized.
2. i am tryiny use dispose(); method.. but also get stuck.. my plan is find if scheduler initialized and if yes, dispose it and after
function initDpScheduler() {
if (typeof DayPilot.Scheduler === 'undefined' || DayPilot.Scheduler === null) {
const dp = new DayPilot.Scheduler("dp");
....
dp.init();
} else {
DayPilot.Scheduler.dispose();
const dp = new DayPilot.Scheduler("dp");
....
dp.init();
}
}
I got error DayPilot.Scheduler.dispose is not a function and if i use instead of it
dp.dispose(); can't access lexical declaration 'dp' before initialization
I know that i am missing something... but don't know what :(