In an ExtJS 6 classic mode application I am trying to configure a menu having both regular items and items with input fields. The idea is to let the user click normal item and then display an item where text can be edited. This is how it looks
items: [{
text : '<b>Add to Favorites</b>',
iconCls : 'ico-new',
hideOnClick : false,
handler : 'onAddToFavorites',
hidden : false,
bind : {
hidden : '{isEditing}'
}
},{
xtype : 'textfield',
iconCls : 'ico-new', // ignored by ExtJS - why?
selectOnFocus: true,
anchor : '100%',
hidden : true,
bind : {
hidden : '{!isEditing}'
}
}];
It works fine, however iconCls property is entirely ignored for items with xtype:'textfield'. Actually, it does not seem to affect anything but regular items.
So the question is how to make ExtJS display menu icon for items containing input fields.
For this problem, if you want to place the desired icon for each item, you should use the iconcls configuration, which displays the icon in black.
But if you want to put the icons in different colors, you should use the cls configuration for each item and create a css or scss file with the same name in the path where the main class is defined, and use the icon content configuration. Enter to display the icon next to each item to be displayed
The third method is that all the items used in the menu have their usehtml configuration set to true. You can use html commands in the text section.