View Full Version : Grid cell defaulting to old value on cell click

6 Feb 2015, 5:33 AM
Brief Description : We have an editable grid. We insert a new row --> edit its cell in 1st column. Again insert a new row--> on clicking the cell for the newly inserted row for that particular column (1st in this example). The data which was entered in the previously inserted row is getting defaulted in the newly inserted row.

Detailed Description: We have a combo box inside grid, the store FruitNameStore contains all the list of fruits from which we can select a fruit and save. The store for grid is FruitTypes.
The scenario here is we insert a row in the grid and select Fruit Name, Again insert a new row and simply click on the cell of the inserted row, the data in previously inserted row is getting defaulted to the newly inserted row. Please note that this happens for other grids also, which does not have cellclick event.

xtype : 'fieldset',
name: 'FruitStoreField',
flex : 1,
margin : '0 5 0 0',
minHeight: 200,

layout : {
type: 'vbox',
align: 'left',
align: 'stretch'
title: 'Fruits Information',
defaults : {
flex: 1

items : [ {

margin : '0 0 0 0',
xtype : 'grid',
autoHeight: true,
modelValidation: true,
bind: {
store: '{FruitTypes}'
plugins: [
Ext.create('Ext.grid.plugin.CellEditing', {
clicksToEdit : 1,
listeners: {
afteredit: 'onAfterEditFruitType',
beforeedit: 'onBeforeEditFruitType'
columns : [
header: '<span style="display:inline-block; text-align:center;">Option<br>No</span>',
align: 'center',
xtype: 'rownumberer'
}, {
text: '<span style="display:inline-block; text-align:center;">Fruit Name<br>Type</span>',
dataIndex: 'FruitCd',
name: 'gridFruitType',
align: 'center',
visible: true,
reference : 'ddgridFruitType',
editor: {
dataIndex: 'FruitCd',
xtype: 'combo',
queryMode: 'local',
triggerCls: 'classddgridFruitType',
typeAhead: true,
store: Ext.getStore('FruitNameStore'),
tpl: Ext.create('Ext.XTemplate',
'<div class="selfContained"><table cellspacing=0 width=100%>',
'<tpl for=".">',
'<tr valign=top height="30px" title="{FruitCd}" class="x-boundlist-item">',
'<td border="true" >{FruitCdDesc}</td>',
displayTpl: Ext.create('Ext.XTemplate',
'<tpl for=".">',
selectOnFocus : true,
displayField : 'FruitCd',
valueField : 'FruitCd',
matchFieldWidth : false,
maxLength: 6,
width : 300,
minHeight: 150,
maxHeight: 150
editable: true,
listeners: {
select: 'fnOnBlur'

} ],

listeners: {
cellclick: 'fnOnCellclick',
select: 'fnOnSelect',
viewready: 'onViewReady'

} ]


This issue is coming up since an upgrade to 5.1 Previous version being used 5.0 did not have this issue.


6 Feb 2015, 1:43 PM
Hi Roger--

Can you provide a test case demonstrating the issue? If you can post your code here or (ideally) create a Fiddle, (https://fiddle.sencha.com/) I'll be happy to test this along with you.

Thanks! Joel