网格上的ExtJS行编辑器

网格上的ExtJS行编辑器,extjs,grid,Extjs,Grid,当我的用户通过RowEditor组合条目和复选框编辑网格时,这很烦人 一个苹果 2橙色 3梨 例如,在上面的组合框中,用户将选择橙色,然后更新-网格现在将显示数字2,而不是说橙色-我希望在成功编辑后显示橙色 我的组合代码 editor : { allowBlank : false, displayField : 'team', editable : false, emptyText : 'Sele

当我的用户通过RowEditor组合条目和复选框编辑网格时,这很烦人

一个苹果 2橙色 3梨

例如,在上面的组合框中,用户将选择橙色,然后更新-网格现在将显示数字2,而不是说橙色-我希望在成功编辑后显示橙色

我的组合代码

     editor : {
       allowBlank     : false,
       displayField   : 'team',
       editable       : false,
       emptyText      : 'Select Team',
       forceSelection : true,
       lazyRender     : true,
       mode           : 'remote',
       name           : 'team',
       store          : storeTeam,
       triggerAction  : 'all',
       valueField     : 'id',
       xtype          : 'combo'
     }
我想我读过,你可以将完整的行发送回insert,或者我应该听一下网格的更新,然后更改字段,但我需要一些关于什么是最好的指导

干杯

我希望这有助于

可以将渲染器定义添加到团队列:

下面是如何在GridPanel中将简单的真/假值表示为是/否的示例:

renderer:function(val){
                if(val=="true" || val == true) {
                    return "Yes";
                }
                else{
                    return "No";
                }
            }

请尝试下面的代码。使用此列就像使用任何其他ExtJS网格列一样

Ext.grid.FixedListColumn = Ext.extend(Ext.grid.Column, {
  constructor: function(cfg){
    cfg.editor = new Ext.form.ComboBox(cfg.editor);
    Ext.grid.ComboBoxColumn.superclass.constructor.call(this, cfg);
    this.renderer = Ext.util.Format.comboRenderer(cfg.editor);
  }
});

Ext.grid.Column.types.fixedlistcolumn = Ext.grid.FixedListColumn;

// Takes in a combobox and returns a renderer that looks up the displayField in
// the store attached to the combo
Ext.util.Format.comboRenderer = function(combo){
    return function(value){
        var record = combo.findRecord(combo.valueField, value);
        return record ? record.get(combo.displayField) : combo.valueNotFoundText;
    }
}

// Use this as the 'columns' parameter when creating your Grid
var grid_columns = [
  {xtype:'fixedlistcolumn',
   store: [[1,'Apple'],[2,'Orange']]},
   ...
];