Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by fathul wahhab on Mar 19, 2009 19:53
open dhtmlx forum
count of dhtmlxWindow object

sample code :
var p = 0;
dhxWins.forEachWindow(function(){p++;});
if (p>4) {
alert("Too many windows");
return;
}

it count all loaded windows object, how to count loaded window object with specific id, so i can avoid duplicate window with same id?.

thx
Answer posted by Alex (support) on Mar 20, 2009 02:31

There is window(id) method which return window object. If window with the certain id doesn't exist, it returns true:

if(!dhxWins.window(id)){

/*window creation code*/

}