Sencha:如何打破Ext.each

fro*_*sty 8 extjs sencha-touch

谁能告诉我如何打破Sencha Ext.each循环?

fro*_*sty 14

如果你返回false就找到我自己的答案,它不会在循环中进行下一次迭代.

Ext.each(arrayObj, function(obj){
    if(obj.isSomethingTrue()){
        doSomething();
        return false; /*this will prevent each from looking at 
                        the next obj in the arrayObj*/
    }
});
Run Code Online (Sandbox Code Playgroud)