Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Giovanni on Apr 29, 2008 12:36
open dhtmlx forum
get object reference in a window

how do you get a reference to an object contained in a window? if I open a new window, adding an url to it, how do I access the elements in this window? there must exist something like parent.window(thisName).thisObject or maybe opener or something similar, but I cannot find it out by testing; anybody knows the answer?
Answer posted by Support on Apr 30, 2008 02:26
We will add more easy way to access inner window in next version of component for now it may be accessed as

    window(name)._content.childNodes[2].firstChild.contentWindow

( kind of ugly , but it works )
Answer posted by Tom Ince on Jun 27, 2008 05:22

This does not work for me.  I do this -

addProjectCommentWindow._content.childNodes[2].firstChild.contentWindow

and get an Object is NULL error.

Answer posted by Support on Jun 27, 2008 06:34
You can try to use attached js file instead of original one, it allows to acces the inline document directly as
    window(name)._frame.contentWindow
Attachments (1)
codebase.zip15.49 Kb
Answer posted by Michael Fiala on Jul 12, 2008 04:56

After some Time of research , this function gives me the window.object

function getWindow(wndName){

return dhxWins.window(wndName).firstChild.firstChild.childNodes[1].firstChild.firstChild.firstChild.firstChild.childNodes[1].firstChild.firstChild.contentWindow;

}

again kind of ugly, but working fo me

it would be fine to have this as a standard feature.

 

 

Answer posted by Support on Jul 14, 2008 02:48
We will add native API method with similar functionality in oncoming update.