mschwartz
15 Apr 2009, 11:36 AM
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');
}
Error: button.replaceClass is not a function
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:
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');
//}
This throws an error, too:
line 3527 ext-all-debug.js
removeClass: function(className) {
var me = this;
if (me.dom.className) {
Examine 'me' and dom is 'undefined', isFlyweight=true
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);
for (var i = 0; i < buttons.elements.length; i++) {
var button = buttons.elements[i];
button.blur();
button.replaceClass('buttonson', 'buttons');
}
Error: button.replaceClass is not a function
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:
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');
//}
This throws an error, too:
line 3527 ext-all-debug.js
removeClass: function(className) {
var me = this;
if (me.dom.className) {
Examine 'me' and dom is 'undefined', isFlyweight=true
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);