Reputation: 6609
Here I'm using ExtJS 5.
I have to display a combobox with the selected value of the another combobox below it.
Use Case:
I have to display the selected value of combobox below the combobox input field as shown in the below image-
This combox field will be used in multiple places.
Here I want to override the template of combobox. But when I configure the "tpl" config with template it is applying to combobox list items instead of combobox.
How to override the default rendering of combobox ?
Upvotes: 0
Views: 1270
Reputation: 6609
You can show required data using different templates in combobox.
For my use case I used "afterSubTpl" to show text below input field of combobox.
Sample Code:
Ext.create('Ext.form.ComboBox', {
fieldLabel: 'Choose State',
store: states,
queryMode: 'local',
displayField: 'name',
valueField: 'abbr',
afterSubTpl: '<div>My Custom Text</div>',
renderTo: Ext.getBody()
});
Upvotes: 0
Reputation: 20224
The Labelable
mixin provides the relevant Templates. You could try afterBodyEl
.
To see how complicated Sencha made it to update the templates, have a look at the code of the setActiveErrors
method.
Upvotes: 2