Sencha: How to Break Out Ext.each

Can someone show me how to break out of the Sencha Ext.each cycle?

+8
extjs sencha-touch
source share
1 answer

found my own answer, if you return false, it will not perform the next iteration of 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*/ } }); 
+14
source share

All Articles