Categories | Question details Back To List | ||
the best way to create x windows dynamically (like mdi apps) Dear support, I wish to allow the user to create n windows where other components are attached to. My idea is to create a global variable winID to identify the windows and use: w=dhxWins.createWindow('MyWindow'+winID, 0, 0, 500, 400); w.winID=winID; gridsArray[winID]=w.attachGrid(); winID++; then I can find the grid in any case with the winID stored in the window. This allow me to refresh all grids at once. Is it the right way? Vincent Answer posted on Oct 15, 2008 09:11 This is one of possible approaches, in such case you will need to attach onClose event, and remove grid reference from collection when some window closed by user. Also, there is a built in itterator for the window, so something similar to next can be used as well dhxWins.forEachWindow(function(win){ // win is equal to dhxWins.window(id) win.grid.load(.... }); The win.grid is an inner reference which created after attachGrid command ( this is not a part of official API and can be changed in next versions ) |