Main Region

Ext.getCmp removeClass not working
1 answer | 1583 views

AW
Jul 8, 2014 09:05 +00:00

Hi Matt,

I'm using

Ext.getCmp('P150_INCREMENTAL_VALUE').addClass('input-greyed-out');

to grey out an input field on a form which works fine, but when I subsequently try to remove this class with

Ext.getCmp('P150_INCREMENTAL_VALUE').removeClass('input-greyed-out');

I get TypeError: Ext.getCmp(...).removeClass is not a function

Any ideas?

Thanks

Alan

2 comments

AW
Alan W Jul 8, 2014 11:17 +00:00 

Hi Matt,

Sorry to trouble you with that. I was looking at some existing code which already had addClass which was working fine, so I'd assumed that removeClass would also.

Thanks for the quick answer.

Alan

MN
Matt Nolan Jul 8, 2014 11:24 +00:00 

No problem, thats what we are here for i.e. to answer your questions.

If you have question relating to javascript methods or config you might get a quicker response on some occassions by checking to see if you can find it in the Sencha documentation: http://docs.sencha.com/extjs/4.0.7/#

Make sure you bookmark it.

MN
Jul 8, 2014 10:53 +00:00

You are using the wrong methods, the addClass is deprecated. Please use the "addCls" and "removeCls" functions as per the Sencha documentation i.e.

http://docs.sencha.com/extjs/4.0.7/#!/api/Ext.AbstractComponent-method-removeCls

0 comments

You must log in or sign up to post questions and answers.