I've been trying for a few days to fill the selectfield's edge picker selector with an XTemplate like this one: <div>BONJOUR <br> {sNotificationTypeTitle}</div>
After many searches in the code database (picker.js, slot.js...), I found how to apply a TPL in the picker slots by replacing the createEdgePicker function like this:
createEdgePicker: function() {
var me = this;
var pickerSlot = {
align: me.getPickerSlotAlign(),
name: me.getValueField(),
valueField: me.getValueField(),
value: me.getValue(),
store: me._pickerStore || me.getStore()
}
if (Ext.isEmpty(me.pickerTpl)) {
pickerSlot.displayField = me.getDisplayField();
}
else {
/**
* ext/modern/modern/src/picker/Slot.js ligne 97
* @cfg {String} itemTpl The template to be used in this slot.
* If you set this, {@link #displayField} will be ignored.
*/
pickerSlot.itemTpl = me.pickerTpl;
}
return Ext.merge({
ownerCmp: me,
slots: [pickerSlot],
listeners: {
change: me.onPickerChange,
scope: me
},
setStore: function(store) {
this.child('pickerslot').setStore(store);
},
deselectAll: function() {
this.child('pickerslot').deselectAll();
}
}, me.getEdgePicker());
},
BUT it only works for TPL on one line, when I tried my final TPL, with
it doesn't work :
With <div>BONJOUR {sNotificationTypeTitle}</div>
With <div>BONJOUR <br> {sNotificationTypeTitle}</div>
Fiddle : https://fiddle.sencha.com/#view/editor&fiddle/2q4j
So if any of you have solved this problem using the same or another solution, please share it;)
I'm using ExtJS 6.6 with modern toolkit.