Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by G R on Jan 18, 2010 10:26
open dhtmlx forum
Iterating through a tree grid- breakiong out of the loop

Hi,
Currently i use the following code to iterate through treegrid

gridtree._h2.forEachChild(0,function(row){
var id=row.id;
//If condition is true
break;
} );

If i wish to break out of the loop based on a condition how do i do that?When i add a break statement ,javascript throws an error it says break cannot be added outside the loop, whats the correct way to do a conditional termination within a tree grid iteration
Answer posted by Alex (support) on Jan 19, 2010 06:46

Hello,

there isn't way to break up the loop from the function.