hi…
i created a layout with this code
dhxLayout = new dhtmlXLayoutObject(document.body, "3J","dhx_skyblue");
a window for editing pages…
myWin_Page=dhxWins.createWindow("myWin_Page",0,0,800,600);
myWin_Page.center();
myWin_Page.hide();
myWin_Page.setText("Add Page");
myWin_Page.setIcon("page.png", "page.png");
myWin_Page.attachEvent("onClose",function(){myWin_Page.hide();return false;});
myWin_Page.show();
myWin_Page.attachURL("form.page.php?id=" + pageid ,true);
added a javascript wysiwyg editor (wyzz) to mywin_Page
and i added a button to wysiwyg editor to open another window for uploading images…
parent.choosePicture(page_id,wysiwyg_id);
function choosePicture(page_id,wysiwyg_id){
myWin_imguploader.show();
myWin_imguploader.setModal(true);
myWin_imguploader.attachURL("form.imguploader.php?&id=" + page_id + "&wysiwyg_id=" + wysiwyg_id, true);
}
i upload the image form myWin_imguploader resize etc… after uploading it triggers the function parent.pageImageUploaded(id,wysiwyg_id); everthing is ok so far…
with this(pageImageUploaded) function i want to call another javascript function insertImage2wysiwyg(wysiwyg_id, image_path) which is located in myWin_Page (form.page.php) and change the wysiwyg source… but i can’t call this function.
i tried
dhxWins.window("myWin_Page").insertImage2wysiwyg(wysiwyg_id, image_path);
dhxWins.window("myWin_Page")._frame.contentWindow.insertImage2wysiwyg(wysiwyg_id, image_path);
dhxWins.window("myWin_Page")._frame.contentDocument.insertImage2wysiwyg(wysiwyg_id, image_path);
what can i do for accessing my function located in myWin_Page (form.page.php) from another function located in parent (index.php)
any ideas? thanks…