Scheduler / Ajax problem

Hello,

I have the scheduler on a page and switch with ajax the data on the scheduler. I load the data in the Ajax Return Message like this :

scheduler.clearAll()
scheduler.config.multi_day = true;		
scheduler.config.xml_date = "%Y-%m-%d %H:%i";
scheduler.init('scheduler_here', null, "week");
scheduler.load("index.php?k=raumbuch&action=dataProcessor&cmd=getRoom&raum_id=<?php echo $data['id']; ?>&nohead=1"); 
 scheduler.config.first_hour = 7;
scheduler.config.last_hour = 20;

If I change the calendar and the Popup open again, i cannot longer close it.

I get the following error if i click on “save”
document.getElementById(sns[i].id) is null
lightbox.js:116

On the first load it works perfectly.

I have the version 2.2 installed.

Thanks and sorry for my bad english.

Daschmi

If you are reloading calendar you need to use

scheduler.clearAll() scheduler.load("...new url...")

You must not call scheduler.init second time, it will break inner logic.

Thanks for your fast answer,

The Problem (i think) is, the container “scheduler_here” is loaded by ajax. Is there a solution for this case ?

I have tried a iframe solution. It works, but the popups where limited to the iframe.

Daschmi

The Problem (i think) is, the container “scheduler_here” is loaded by ajax.
Must not be the problem. If container already exists on the page, on moment of scheduler.init call then it doesn’t matter how it was loaded.

Original error may appear in case

  • double initialization
  • removing scheduler’s elements by HTML operatons ( if you are doing some massive innerHTML operations with DOM after scheduler’s initialization )

Hi,

Its complex. The calender is included in a tab which loaded by Ajax. On the first time it works perfekt. But if i switch to a other room (with a other calender) the tabs where removed from the DOM and loaded new with ajax. So i think i must reinit the calender.

I searched for a solution to completly reinit the calender.

Greetings

Daschmi

Scheduler will not work in such scenario. Some parts of its code is created to run only once ( they auto remove self , after first execution ) , so there is no way to fully re-init scheduler.

Hi Stanislav,

Thanks for your answer.

Daschmi