2012-02-03 7 views

Trả lời

14

tìm thấy câu trả lời của riêng tôi nếu bạn trả về false, nó sẽ không lặp lại tiếp theo trên vòng lặp.

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