PDA

View Full Version : Composite elements and the dom



DrZog
19 Apr 2007, 4:32 AM
Is there a way to do this:


for(var i=1;i<NoClasses;i++){
Ext.get('class'+i).dom.checked = '';
}


Like this?


Ext.select('div [id^=class]').dom.checked = '';// I don't work

Animal
19 Apr 2007, 4:48 AM
What's needed is for Ext.Element to export the DOM element's setAttribute method. Then CompositeElement would inherit it and you could use that...

neror
19 Apr 2007, 6:47 AM
Actually, Element has a generic set() method that is inherited by CompositeElement. Set takes an object, and adds/updates the attributes in the dom element.

http://extjs.com/deploy/ext/docs/output/Ext.Element.html#set

This should work:


Ext.select('div [id^=class]').set({'checked':''});

DrZog
19 Apr 2007, 6:54 AM
Thanks for helping out yet again neror...the master of the dom! :D