我有一个网格,其标签列如下:
Ext.application({
name : 'Fiddle',
launch : function() {
Ext.create('Ext.data.Store', {
storeId: 'tagStore',
fields:[ 'id', 'name'],
data: [
{ id: '123', name: 'cartoon'},
{ id: '124', name: 'animation'},
{ id: '125', name: 'comedy'},
{ id: '126', name: 'action'}
]
});
Ext.create('Ext.data.Store', {
storeId: 'movieStore',
fields:[ 'name', 'tags'],
data: [
{ name: 'Simpsons', tags: '123,124'},
{ name: 'Zootopia', tags: '123,124,125' },
{ name: 'The Godfather', tags: '126' },
{ name: 'La La Land', tags: '123' }
]
});
Ext.create('Ext.grid.Panel', {
title: 'Movies',
store: Ext.data.StoreManager.lookup('movieStore'),
columns: [
{ text: 'Name', flex: 2,dataIndex: 'name' },
{ text: 'Tags', flex: 3,dataIndex: 'tags'}
],
renderTo: Ext.getBody()
});
}
});
Sencha小提琴链接是https://fiddle.sencha.com/#view/editor&fiddle/1u84
我想更改网格,以便能够使用tagfield编辑标记列,以便显示名称而不是ID,但是当您更新网格时,它将发送id而不是标记名称。