View Full Version : How to change triggerClass on the fly?

25 Aug 2010, 10:14 AM

I have a triggerField with a triggerClass set to 'x-form-search-trigger'... I need to change it on the fly (runtime) with effect. I mean I am able to change its class like this:

new Ext.form.TriggerField({
'fieldLabel': 'Search',
'triggerClass': 'x-form-search-trigger',
'onTriggerClick': function() {
this.triggerClass = 'newClassName';

It changes its classes but have no effect :(.... Search icon is still there!

What should be done here?

25 Aug 2010, 10:20 AM
Set the class on the element!

It's no good just setting a Javascript variable!