Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Gemorroj on Jan 04, 2010 08:18
open dhtmlx forum
Updated in Lightbox

Hello.
I am doing this:
scheduler.attachEvent("onBeforeLightbox", function (id) {
scheduler.load("/account/modules/procurements/resources/scheduler.php?id=" + id);
alert(id);
return true;
});
server gives the following data:
<?xml version="1.0" encoding="UTF-8"?>
<data>
<event id="341">
<text>компания</text>
<rec_type>week_1___1,4,5#no</rec_type>
<event_length>1209600</event_length>
<start_date>2010-11-01 00:00</start_date>
<end_date>2010-18-02 23:59</end_date>
</event>
</data>
If the I remove the alert(id) from this code, then the data in Lightbox is unaffected. How can I solve this without calling of alert?
Answer posted by Alex (support) on Jan 05, 2010 02:49

Hello,

loading is asynchronous. You can try to use the following approach:

var showLB = false

scheduler.attachEvent("onBeforeLightbox",function(id){

  scheduler.load("/account/modules/procurements/resources/scheduler.php?id=" + id,function(){
    showLB = true
    scheduler.showLightbox(id);
    showLB = false
 }); 

 return showLB;

})