Ext


Go Back   Ext JS Forums > Ext JS Community Forums (3.0) > Ext: Bugs

Reply
 
Thread Tools
  #1  
Old 07-08-2009, 04:30 AM
Condor's Avatar
Condor Condor is offline
Ext JS - Community Support Team
 
Join Date: Mar 2007
Location: The Netherlands
Posts: 15,377
Condor is on a distinguished road
Default [OPEN-73] [3.x] Ext.iterate callback parameters

This is not technically a bug, but an inconsistency.

When calling Ext.iterate with an array the callback parameters are:
(Object item, Number index, Array allItems)
But when calling Ext.iterate with an object the callback parameters are:
(String key, Object value)
I would like to suggest changing the callback parameters for objects to:
(Object value, String key, Object obj)
so it matches the array callback.
Reply With Quote
  #2  
Old 07-08-2009, 04:37 AM
evant's Avatar
evant evant is offline
Ext JS - Development Team
 
Join Date: Apr 2007
Location: Sydney, Australia
Posts: 8,550
evant is on a distinguished road
Default

I think the horse has already bolted, we can't really change the parameter order, though we could pass the object itself as the 3rd parameter.
__________________
Evan Trimboli
Ext JS - Core Development Team
evan@extjs.com
Reply With Quote
  #3  
Old 07-08-2009, 08:35 AM
aconran's Avatar
aconran aconran is offline
Ext JS - Development Team
 
Join Date: Mar 2007
Posts: 3,761
aconran is on a distinguished road
Default

Wish we would have seen this one before 3.0.0 final drop. Going to close this as we cannot change the API at this point.
__________________
Aaron Conran
Ext JS - Core Development Team
Reply With Quote
  #4  
Old 07-08-2009, 08:56 AM
Condor's Avatar
Condor Condor is offline
Ext JS - Community Support Team
 
Join Date: Mar 2007
Location: The Netherlands
Posts: 15,377
Condor is on a distinguished road
Default

Wouldn't OPEN-DEF state be more appropriate?
Reply With Quote
  #5  
Old 07-08-2009, 09:10 AM
aconran's Avatar
aconran aconran is offline
Ext JS - Development Team
 
Join Date: Mar 2007
Posts: 3,761
aconran is on a distinguished road
Default

DEFered until 4.0? We can't break the API in the 3.x branch.
__________________
Aaron Conran
Ext JS - Core Development Team
Reply With Quote
  #6  
Old 07-08-2009, 09:19 AM
Animal's Avatar
Animal Animal is offline
Ext JS - Community Support Team
 
Join Date: Mar 2007
Location: East Midlands, UK
Posts: 24,303
Animal will become famous soon enough
Default

How widely used is this new method among customers?
__________________
ExtJs forum volunteer. No official connection to the Ext Company. I do not speak for them.
ExtJs consultancy offered. £ 50/hour. Evenings+weekends. the_bagbournes@btinternet.com

Search the forum: http://www.google.com/coop/cse?cx=01...%3Az7of1ufqccu
Read the docs too: http://extjs.com/deploy/dev/docs/
See Saki's samples: http://examples.extjs.eu/
Build your own Ext: http://extjs.com/products/extjs/build/
Scope: http://extjs.com/forum/showthread.ph...642#post257642
Reply With Quote
  #7  
Old 07-08-2009, 09:22 AM
aconran's Avatar
aconran aconran is offline
Ext JS - Development Team
 
Join Date: Mar 2007
Posts: 3,761
aconran is on a distinguished road
Default

So.... I'm marking this as OPEN but only to add the 3rd argument, not to switch the order.

Animal, you make a good point but if we doc it and its in the docs then people will use it (even if they don't need to)
__________________
Aaron Conran
Ext JS - Core Development Team
Reply With Quote
  #8  
Old 07-08-2009, 10:03 AM
mschwartz's Avatar
mschwartz mschwartz is online now
Ext JS Premium Member
 
Join Date: Nov 2008
Posts: 1,204
mschwartz is on a distinguished road
Default

You can add API methods:

Ext.iterateArray()
Ext.iterateObject()

Mark in the docs that the old iterate() is deprecated.
Reply With Quote
  #9  
Old 07-08-2009, 04:30 PM
mjlecomte mjlecomte is offline
Ext JS - Quality Assurance Team
 
Join Date: Jul 2007
Location: Florida
Posts: 10,008
mjlecomte is on a distinguished road
Default

Quote:
Originally Posted by mschwartz View Post
You can add API methods:

Ext.iterateArray()
Ext.iterateObject()

Mark in the docs that the old iterate() is deprecated.
This would not help, the point is that we're striving to only remove deprecated items or make a breaking change in the API in the next major release (4.x).
Reply With Quote
Reply

Thread Tools

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

All times are GMT -5. The time now is 01:36 PM.

© 2006-2009 Ext, LLC
Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.