帶編輯器網格的緩衝存儲區。EXTJS 4.2.0.663:帶編輯器網格的緩衝存儲區
我們一直在使用4.1.1版本並且正在遷移到4.2.0.663。我們擁有包含大量數據的緩衝存儲的編輯網格。編輯器網格類似於行編輯示例(除了它使用緩衝存儲)。但對於電網的附加功能已經遷移後停止,它會引發錯誤
Ext.Error: insert operation not supported into buffered Store.
var rowEditing = Ext.create('Ext.grid.plugin.RowEditing', {
clicksToMoveEditor: 1,
autoCancel: false
});
// create the grid and specify what field you want
// to use for the editor at each column.
var grid = Ext.create('Ext.grid.Panel', {
store: store,
columns: [{
header: 'Name',
dataIndex: 'name',
flex: 1,
editor: {
// defaults to textfield if no xtype is supplied
allowBlank: false
}
}, {
header: 'Email',
dataIndex: 'email',
width: 160,
editor: {
allowBlank: false,
vtype: 'email'
}
}, {
xtype: 'datecolumn',
header: 'Start Date',
dataIndex: 'start',
width: 90,
editor: {
xtype: 'datefield',
allowBlank: false,
format: 'm/d/Y',
minValue: '01/01/2006',
minText: 'Cannot have a start date before the company existed!',
maxValue: Ext.Date.format(new Date(), 'm/d/Y')
}
}, {
xtype: 'numbercolumn',
header: 'Salary',
dataIndex: 'salary',
format: '$0,0',
width: 90,
editor: {
xtype: 'numberfield',
allowBlank: false,
minValue: 1,
maxValue: 150000
}
}, {
xtype: 'checkcolumn',
header: 'Active?',
dataIndex: 'active',
width: 60,
editor: {
xtype: 'checkbox',
cls: 'x-grid-checkheader-editor'
}
}],
renderTo: 'editor-grid',
width: 600,
height: 400,
title: 'Employee Salaries',
frame: true,
tbar: [{
text: 'Add Employee',
iconCls: 'employee-add',
handler : function() {
rowEditing.cancelEdit();
// Create a model instance
var r = Ext.create('Employee', {
name: 'New Guy',
email: '[email protected]',
start: Ext.Date.clearTime(new Date()),
salary: 50000,
active: true
});
store.insert(0, r);
rowEditing.startEdit(0, 0);
}
}],
plugins: [rowEditing],
});
請對什麼是應遵循的方法提出建議。
您是否提交過錯誤或升級? – dbrin 2013-07-29 17:55:04
不,我沒有提交錯誤,也無法升級,因爲我們在大規模使用緩衝存儲,並需要能夠使用它與編輯器網格。 – 2013-07-30 04:57:26