2012-02-03 26 views

回答

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*/ 
    } 
});