2012-02-03 8 views
8

से कैसे बाहर निकलना है कोई भी मुझे दिखा सकता है कि सेन्चा Ext.each लूप से कैसे बाहर निकलना है?सेन्चा: Ext.each

उत्तर

14

यदि आप झूठी वापसी करते हैं तो मेरा अपना जवाब मिला, यह लूप पर अगला पुनरावृत्ति नहीं करेगा।

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