0
下面是在网格编辑器中有一个按钮的可执行代码片段。我需要按钮出现在编辑器中,但是我不需要按钮的任何值来更新。编辑器的更新功能似乎不再适用。任何想法我可能会失踪?ExtJs(4.2.0)带xtype:按钮列的可编辑网格
Ext.create('Ext.data.Store', {
storeId:'EmployeeData',
fields:['name', 'email', 'phone'],
data: [
{"name":"aaa", "email":"[email protected]", "phone":"987654321"},
{"name":"bbb", "email":"[email protected]", "phone":"987654321"},
{"name":"ccc", "email":"[email protected]", "phone":"987654321"},
{"name":"ddd", "email":"[email protected]", "phone":"987654321"}
]});
var grid = Ext.create('Ext.grid.Panel', {
title: 'Employee',
store: Ext.data.StoreManager.lookup('EmployeeData'),
columns: [
{header: 'Name', dataIndex: 'name', editor: 'textfield'},
{header: 'Email', dataIndex: 'email', flex:1,
editor: {
xtype: 'textfield',
allowBlank: false
}
},
{header: 'Phone', dataIndex: 'phone'},
{header: 'button', dataIndex:'',editor:{xtype:'button',editable: false}}
],
selType: 'rowmodel',
plugins: [
Ext.create('Ext.grid.plugin.RowEditing', {
clicksToEdit: 1,
pluginId: 'rowEditing'
})
],
height: 200,
width: 400,
renderTo: Ext.getBody()
});
它松散的代码应该产生一个4行4列的网格。你在期待什么? – Joe
如果您碰巧阅读了说明,它说因为有一列xtype按钮,编辑器不起作用。 – user997805
你可以在小提琴中运行这个。由于xtype按钮列,编辑器不起作用。 – user997805