PDA

View Full Version : [2.1] Ext.Element.select broken



mankz
14 Nov 2012, 7:32 AM
Seems Element.select selects globally, very unexpected.


Ext.getBody().setHtml('<div id="mydiv"><img/></div><img/>');
console.log(Ext.get('mydiv').select('img').getCount());

Ext JS gets it right, shows 1:
ST 2.1 shows 2.

mitchellsimoens
14 Nov 2012, 7:42 AM
For ST 2.1, this works for me:


Ext.getBody().setHtml('<div id="mydiv"><img/></div><img/>');
console.log(Ext.get('mydiv').select('img').getCount());

It gives 1 for the getCount. Had to change the update method to setHtml to be ST2 compliant.

mankz
14 Nov 2012, 7:48 AM
40044Not so fast, try below.

1. http://docs.sencha.com/touch/2-1/touch-build/examples/geocongress/index.html

2. Launch test case => logs 2

mitchellsimoens
14 Nov 2012, 9:19 AM
I see what the issue is now, the actual root isn't being passed properly and this bug is causing it: http://www.sencha.com/forum/showthread.php?247600

mankz
14 Nov 2012, 9:23 AM
Yup, that seems to be it - now dump this case into your test suite ;)