Window is not fully built in afterShow


#1

I have a window with a div:

dhxWindowObj.attachHTML("<div id='"divTest"' >test</div>");

I want to work with the div so I am trying to access it in this event

    dhxWindowObj.events.on("afterShow", function(id){                       
        $('#divTest').load(url);        
    });

but $(’#divTest’) is undefined in this event. Since there is no afterLoad event I assumed the window is fully built after it is shown but seems not to be the case - is this a bug or is there a missing event on the Window object?


#2

Hello,
If you attach the event after the Window is displayed, it will fire only after you open the Window again:
After:
https://snippet.dhtmlx.com/m504ei9h
Before:
https://snippet.dhtmlx.com/enfomckj

If that doesn’t help you, please, reproduce the issue in the snippet, then click on the “Save” button and send me the link.


#3

I am attaching the event before the show like this
https://snippet.dhtmlx.com/8monk3al
and this is when I get the error ie. I’m looking for an event similar to document ready but for the window object.