View Full Version : How to change a component's config dynamically?

28 Nov 2011, 10:26 AM
For example, when I select one value, a certain combo should be set "multiSelect: false". And when I select another value, the combo will be "multiSelect: true" to allow multiselect.

Can this be done?

28 Nov 2011, 11:04 AM
In general you can't change config options dynamically. It depends on the component and the config option as to whether it is possible. Many config options are interpreted only at instantiation time without support for subsequent changes.

For multiSelect on a combobox it would be a little fiddly. Just switching the property value would get you most of the way there but you'd have to muck around with the bound list picker to change its selection model. It'd almost certainly be easier just to create a new combobox.

30 Nov 2011, 5:58 PM
Could you show me a very simple example? Thanks a lot!

30 Nov 2011, 5:59 PM
Could you show me a very simple example? Thanks a lot!

Of what?

15 Jan 2012, 9:34 PM

I have the same thing to be done in a fieldset. Could you show me an example to change the config properties dynamically?

15 Jan 2012, 11:23 PM
@narram123. Please can you start a new thread explaining exactly what you're trying to do? As I explained previously it isn't possible to change config options in the general case so your question will need to be specific.

27 Jun 2012, 12:10 PM
[component grid object or getCmp].selModel.setSelectionMode('MULTI');

[component grid object or getCmp].selModel.setSelectionMode('SINGLE');