Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by greg on Mar 18, 2009 10:44
open dhtmlx forum
dhxWins - loading an object *and* fetching content via AJAX

Is there any way to use the "attachObject" and "attachURL" functions on the same window?

What I am attempting to do is load an object into a modal window:
myModal.attachObject('obj_id');

and then append dynamic content (via ajax request), to that window:
myModal.attachURL(my_url, true);

One solution that I was pondering, was to add a callback function to the "attachURL" ajax call, so that I could insert the object after the dynamic content was loaded. But I could not find a way to add a callback to the ajax request.

It would be ideal if the "attachURL" function returned the deferred:
var def = myModal.attachURL(my_url, true);
def.addCallback(myCallbackFunction, [param1, [param2],...]);

Please advise.
Answer posted by Alex (support) on Mar 19, 2009 03:44

You can try to use the following approach:

dhxWins.attachEvent("onContentLoaded",function(){
  myModal.appendObject('obj_id')
 })

myModal.attachURL(my_url, true);