Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Sencha: How to break out of Ext.each

Can anyone show me how to break out of a Sencha Ext.each loop?

like image 890
frosty Avatar asked Feb 03 '12 18:02

frosty


Video Answer


1 Answers

found my own answer if you return false, it will not do the next iteration on the loop.

Ext.each(arrayObj, function(obj){
    if(obj.isSomethingTrue()){
        doSomething();
        return false; /*this will prevent each from looking at 
                        the next obj in the arrayObj*/
    }
});
like image 84
frosty Avatar answered Oct 04 '22 13:10

frosty