<script>
dhxWins = new dhtmlXWindows();
var idPrefix = 1;
/*
- url= address
- title: titol of the window
- w: width
- h: height
- r: is resizable?
*/
function createWindow(url, title, w, h, r) {
var p = 0;
dhxWins.forEachWindow(function(){p++;});
if (p>=5) {
dhtmlx.message({
title:"Important!",
type:"error",
text:"Not more than 5 windows are allowed"
});
return;
}
var id = "userWin "+(idPrefix++);
var win = dhxWins.createWindow(id, 20, 50, w, h);
win.setText(title);
var winId= dhxWins.window(id)
dhxWins.window(id).center();
win.button("park").hide();
win.button("minmax1").hide();
win.attachURL(url);
dhxWins.window(id).keepInViewport(true);
if(r==0){win.denyResize();}
};
</script>
Now I have 2 questions:
on the created window how can I get the id of the page, the getId() function don’t works
if the created window (window 2) is created on the parent (parent.createWindow(…) from another window (window 1) is there a way to obtain in window 2 the id of the first window, if the window would be created on the window 1 this window would be the parent, but in this case it’s not the parent but like a sister
But where I have to place this code. I have 3 files:
is the “start file” in which i open the window using the createwindow.php file with a script like: onclick=’ parent.createWindow(“test.php?ID=1”,“Incassa conteggio commissioni”,450,280,0);"
is the createwindow.php file that is fundamentally the script that generates the windows (see code on the first page
the test.php file that is the file loaded in the window and it’s inside the window that I have to get the windows ID, so that I can for example change the size of the window, or the name, or simply close it.
And inside of the window the getID don’t work
As example here a code that I would like to use inside the window:
Do you want to get the id of the window inside the iframe attached to that window? You may send the id of a created window as a parameter of an url to a content of that window and get it wen it needed from the url window.location.search