PDA

View Full Version : 1.0[b1] JSONReader Combo Box Strange Behavior



jon.whitcraft
5 Apr 2007, 4:26 AM
I have a dynamic combo box and a static Ext combo box and i just noticed something this morning.

When you click on the dynamic combo box and open up the options it has the first one selected but if you don't select an option and just click off the control and then open it again it has the second one selected not the first. It does this till it gets to the end.

here is my test page.

http://dev2.indycar.com/online/jon/combobox/

Series is the dynamic one and Status is just a transformed select box. It does this in both FF2 and IE7

oxi
8 Apr 2007, 6:16 PM
Thanks for the example. Did you solve this issue yet?

jon.whitcraft
8 Apr 2007, 7:42 PM
No i have not. I'm waiting to see if it's fixed with beta 2.

mystix
9 Apr 2007, 5:48 PM
interesting... saw this line in ext-all-debug.js line 19533:
this.selectNext();called from the ComboBox's onLoad() method.

that's the only suspicious line i see. try setting a b.p. there and let us know what you discover.


p.s.: attached below is the selectNext() method for reference:
selectNext : function(){
var ct = this.store.getCount();
if(ct > 0){
if(this.selectedIndex == -1){
this.select(0);
}else if(this.selectedIndex < ct-1){
this.select(this.selectedIndex+1);
}
}
}

jon.whitcraft
9 Apr 2007, 6:16 PM
that is what is causing it as it's not re running the query as you have not selected anything..

mystix
9 Apr 2007, 6:31 PM
:) haha. so he's cycling through all options for you when u don't select anything... strange behaviour IMO but perhaps he had something in mind when he put it there. anyhow, it seems fine to just remove it / override the function for now since the only impact it makes is visual.

jack.slocum
9 Apr 2007, 11:19 PM
This is fixed in svn. (should be)