[CLOSED] Use of each

  1. #1

    [CLOSED] Use of each

    Hello,

    I would want to understand why the use of Ext.each.

    I declare a handler for the beforeaction.

    The following code doesn't work

     
    beforeActionHandler(form, action){
     Ext.each(form.items, function(item){
     });
    }
    The following code works.

    beforeActionHandler(form, action){
     form.items.each(function(item){
     });
    }
    Can someone explain me the difference between the 2 codes?

    Romuald.
    Last edited by Daniil; May 04, 2011 at 3:43 PM. Reason: [CLOSED]
  2. #2
    Hi,

    Ext.each() expects a real array, but form.items is a MixedCollection instance, not an array.
    http://dev.sencha.com/deploy/ext-3.3...on&member=each
    http://dev.sencha.com/deploy/ext-3.3...xt&member=each
  3. #3
    Thanks for the quick anwser that is really helpful.

    Romuald

Posting Permissions