this is my grid source (part of a successHandle function of an Ajax call):
First time the grid is rendered when I double click on the cell (with the comboBox) and select the value, the alert window comes up showing the field value. Then, if I click on another cell (of the same column) before to see the combobox an alert window comes up with the last edited value.
I choose another value for the cell and another alert window comes up with the new value.
It seems that afteredit is called before edit the cell if another cell is already being edited and again after the cell has been really edited.
bye
entity = Ext.util.JSON.decode(o.responseText);
specialFields = [
{name: 'Username', field:''},
{name: 'Password', field:''},
{name: 'Email', field:''},
{name: 'Nome', field:''},
{name: 'Cognome', field:''}
];
fields = new Array();
var flimit = entity.fields.length;
for(var i = 0; i < flimit; i++){
fields[i] = {
id: entity.fields[i].iId,
name: entity.fields[i].labels['1'],
validation: '',
regex: '',
errmsg: '',
unique: '',
editable: true,
visible: true,
sfield: ''
};
}
var ds = new Ext.data.Store({
proxy: new Ext.data.MemoryProxy(specialFields),
reader: new Ext.data.ArrayReader({id: 0}, [
{name: 'name', mapping:'name'},
{name: 'field', mapping:'field'}
])
});
ds.load();
var store = new Ext.data.SimpleStore({
fields: [
{name: 'id', mapping:'id'},
{name: 'name', mapping:'name'},
{name: 'validation', mapping:'validation'},
{name: 'regex', mapping: 'regex'},
{name: 'errmsg', mapping: 'errmsg'},
{name: 'unique', mapping: 'unique'},
{name:'editable', mapping: 'editable'},
{name: 'visible', mapping: 'visibile'},
{name: 'sfield', mapping: 'sfield'}
],
data: fields
});
var colModel = new Ext.grid.ColumnModel([
{header: "Campo speciale", width: 200, locked:false, dataIndex: 'name'},
{
header: "Campo Entitá",
width: 200,
dataIndex: 'field',
editor: new Ext.form.ComboBox({
store: store,
displayField: 'name',
mode: 'local',
triggerAction: 'all'
})
}
]);
var grid = new Ext.grid.EditorGrid('config-entity-grid',{
ds: ds,
cm: colModel
});
grid.render();
//eventi
grid.on('afteredit',function(e){alert(e.record.data['field']); }.createDelegate(this));
I choose another value for the cell and another alert window comes up with the new value.
It seems that afteredit is called before edit the cell if another cell is already being edited and again after the cell has been really edited.
bye

|
#2
|
|
This will be fixed in the coming rev. Thanks.
![]() |
本文描述了一个使用ExtJS创建网格编辑界面过程中遇到的问题。当在网格单元格中使用下拉框进行选择时,触发了两次afteredit事件,分别在编辑另一个单元格前和真正编辑完单元格后。此现象将在未来的版本中修复。
113

被折叠的 条评论
为什么被折叠?



