Alpha 3 bug? afteredit behaviour - Ext JS

本文描述了一个使用ExtJS创建网格编辑界面过程中遇到的问题。当在网格单元格中使用下拉框进行选择时,触发了两次afteredit事件,分别在编辑另一个单元格前和真正编辑完单元格后。此现象将在未来的版本中修复。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

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
Reply With Quote
  #2  
Old 03-12-2007, 11:18 PM
Default

This will be fixed in the coming rev. Thanks.
Reply With Quote
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值