【问题标题】:Sencha: How to break out of Ext.eachSencha:如何突破 Ext.each
【发布时间】:2012-02-03 18:13:17
【问题描述】:

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

【问题讨论】:

    标签: sencha-touch extjs


    【解决方案1】:

    如果您返回 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*/
        }
    });
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2016-06-26
      • 2014-08-05
      • 2012-11-27
      • 1970-01-01
      • 2011-09-12
      • 2019-05-23
      • 2016-04-01
      • 1970-01-01
      相关资源
      最近更新 更多