JavaGeek
JavaGeek

Reputation: 1529

unable to remove class using ext js

I'm trying to remove a class as below but its not working.

Ext.onReady(function () {
    Ext.select('div').on('click', function () {
        Ext.get('div').removeClass('tst2');
    })
});

http://jsfiddle.net/zhvKn/4/

Upvotes: 0

Views: 3798

Answers (1)

CD..
CD..

Reputation: 74146

You need to pass Ext.get the id of the node or a DOM Node or an existing Element.

You can do it like this:

Ext.select('div').on('click', function () {
    Ext.get(this).removeCls('tst2');
});

http://jsfiddle.net/vGLQt/1/

Upvotes: 4

Related Questions