-
15 Apr 2009 11:36 AM #1Sencha - Community Support Team
- Join Date
- Nov 2008
- Location
- San Diego, Peoples' Republic of California
- Posts
- 2,040
- Vote Rating
- 7
[CLOSED][3.0] Ext.select is broken
[CLOSED][3.0] Ext.select is broken
Error: button.replaceClass is not a functionCode:var buttons = Ext.select('a.buttonson', true); for (var i = 0; i < buttons.elements.length; i++) { var button = buttons.elements[i]; button.blur(); button.replaceClass('buttonson', 'buttons'); }
I examine buttons in firefox and it's now a CompositeElement:
buttons[] :
--- el
------ isFlyweight: true
------ replaceClass: function() <--- ok, so it's moved, right?
--- elements[] :
------ clientLeft: 1 <--- it's a DOM node, not an Ext.Element anymore
So I read the docs on CompositeElements and I modify my code thus:
This throws an error, too:Code:var buttons = Ext.select('a.buttonson', true); // new 3.0 code buttons.el.replaceClass('buttonson', 'buttons'); // old 2.2 code //for (var i = 0; i < buttons.elements.length; i++) { // var button = buttons.elements[i]; // button.blur(); // button.replaceClass('buttonson', 'buttons'); //}
line 3527 ext-all-debug.js
Examine 'me' and dom is 'undefined', isFlyweight=trueCode:removeClass: function(className) { var me = this; if (me.dom.className) {
So what is the bug I'm reporting?
This line, the 'true' argument is being ignored or not behaving like 2.2 or the 3.0 docs say it should:
var buttons = Ext.select('a.buttonson', true);
-
15 Apr 2009 11:38 AM #2Sencha - Community Support Team
- Join Date
- Nov 2008
- Location
- San Diego, Peoples' Republic of California
- Posts
- 2,040
- Vote Rating
- 7
buttons.replaceClass() works, btw.
-
15 Apr 2009 12:33 PM #3
elements is an private property, it retrns a series of DOM elements.
You should use:
Code:Ext.select('div.foo').each(function(el){ el.blur(); el.replaceClass('foo', 'bar'); });Evan Trimboli
Sencha Developer
Twitter - @evantrimboli
Don't be afraid of the source code!
Thank you for reporting this bug. We will make it our priority to review this report.


Reply With Quote