EXTJS 4 render HTML of a selected value in a combobox

后端 未结 2 1193
情话喂你
情话喂你 2020-12-09 12:52

Hello I have the next problem, I want to render the html of my display value in a combobox, at the moment I load a store with the html ready, it renders the html when I show

2条回答
  •  南方客
    南方客 (楼主)
    2020-12-09 13:19

    We have similar task to display selected color. Our solution is overriding of combobox template:

    var store = new Ext.data.SimpleStore({
        fields: ['num','id', 'color']
    });
    
    var tplColor = new Ext.XTemplate(
        '
    ', '
     
    ', '
    ' ); new Ext.form.ComboBox({ tpl: tplColor, store: store, ... };

    You can do something similar but use image instead of background-color.

提交回复
热议问题