Alpha 3 bug? afteredit behaviour - Ext JS

this is my grid source (part of a successHandle function of an Ajax call):

		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&aacute;",
										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));
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
  # 2  
03-12-2007, 11:18 PM

This will be fixed in the coming rev. Thanks.

你可能感兴趣的:(Ajax,json,ext,UP)