Reputation: 305
I have a simple select query to select DOM node:
var selectNode = Ext.select('.myCSSClass textarea');
I want to apply a css class to textarea.
I have tried:
selectNode.addCls('newClass');
I have also tried using Ext.ComponentQuery to select the node and it doesn't work.
I also tried using the apply() method:
Ext.apply(selectNode, {
cls: 'newClass'
});
Upvotes: 1
Views: 1835
Reputation: 12949
Ext.select
returns a array of elements that respond to the CSS selector you gave.
If you want to add a CSS class to the class
attribute of this element you have to do this :
Ext.select('.css-class').elements[0].className += ' myClass'; // don't forget the space
Example :
Hope this helps
Upvotes: 1