View Code
var isEdit = false;//这变量和后面的方法写在ext.onready里面 cbstore = createStore(); function rendererData(value, metadata, record) { if (isEdit) { var index = cbstore.find(Ext.getCmp('cengm').valueField, value); var record = cbstore.getAt(index); return record.data.name; } else { return value; } } function createStore() { // The data store holding the states; shared by each of the ComboBox examples below return Ext.create('Ext.data.Store', { autoDestroy: true, model: 'State', data: states }); } { header: '层面', 70, sortable: true, dataIndex: 'cengm', field: { xtype: 'combobox', id: 'cengm', typeAhead: true, triggerAction: 'all', queryMode: 'local', selectOnTab: true, lazyRender: true, displayField: 'name', valueField: 'id', store: createStore(), listeners: { select: function (combo, record, index) { isEdit = true; }//选中后事件,其他事件没试验成功 } //value: '01' //editable: false }, renderer: rendererData }