Extjs4 combobox displayValue in grid

后端 未结 2 573
时光取名叫无心
时光取名叫无心 2021-01-03 01:37

Please, help. I want to show my displayValue in the Grid. I found the solution here, but I can\'t understand how use it. My code:

columns:[...,{         


        
2条回答
  •  情书的邮戳
    2021-01-03 02:35

    var myStore = new Ext.data.Store({
        fields: ['value','display'],
        data: prod_list
    });
    

    ...

                editor: {
                    xtype: 'combobox',
                    store: myStore,
                    displayField: 'display',
                    valueField: 'value'
                },
                renderer: function(val){
                    index = myStore.findExact('value',val); 
                    if (index != -1){
                        rs = myStore.getAt(index).data; 
                        return rs.display; 
                    }
                }
    

提交回复
热议问题