Ext.iterate Array vs. Object Gotcha!

When calling Ext.iterate with an object the parameters passed back to the iterated function are:

(String key, Object value)

However when calling Ext.iterate with an array the parameters are:

(Object item, Number index, Array allItems)

The gotcha here is that in the Ext 3.0 docs only the object call back is shown.  Because of this you might think that the array call returns the index then the actual item bu as you can see that is not the case.

There is a thread on the Ext forum here about maybe making this consistent in the next major release.

Advertisement

Leave a Comment

Filed under ExtJS

Leave a Reply

Fill in your details below or click an icon to log in:

Gravatar
WordPress.com Logo

Please log in to WordPress.com to post a comment to your blog.

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s