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?
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.
I have the same issue. I have a dhx Form attached to my window. I’m trying to set the focus to an input field when the window is shown.
win.events.on("AfterShow",function(){
var el = document.getElementById("ClockNumber");
el.focus();
});
// throws error, cannot access property of non-object... el is null
But…
win.events.on("AfterShow",function(){
setTimeout(function(){
var el = document.getElementById("ClockNumber");
el.focus();
},1000);
}
// works, but I don't feel I should have to use setTimeout if the event is "AfterShow"