PDA

View Full Version : [FIXED] 4.0.2 Cell not editing correct value when data in cell is updated..



MHjerpe
20 Jun 2011, 11:05 PM
REQUIRED INFORMATION


Ext version tested:

Ext 4.0.2


Browser versions tested against:

Chrome
FF5


Description:

Cell not editing correct value when data in cell is updated


Steps to reproduce the problem:

Click on row 1 , column 1 enter a value.
Press TAB +1 is added to column 2 and column3
But the value to be edited in column2 is still 1.
If you leave it and come back it show correct (err 3 since column two also fires the edit event )
Get same behavior when updating cells via Ajax/xml call..



Test Case:



Ext.onReady(function ()
{
var myData = [ [1,1,1],[2,2,2] ];

var store = Ext.create('Ext.data.ArrayStore', {
fields: [
{name: 'one', type: 'float'},
{name: 'two', type: 'float'},
{name: 'three', type: 'float'}
],
data: myData
});

var editor = Ext.create('Ext.grid.plugin.CellEditing', {
clicksToEdit: 1,
listeners: {
edit: function(ed, oe)
{
//alert('New value (edit): ' + e.value);
var tmp_2 = oe.record.get('two');
var tmp_3 = oe.record.get('three');

tmp_2++;
tmp_3++;

oe.record.set('two',tmp_2);
oe.record.set('three',tmp_3);

}
}
});

var grid = Ext.create('Ext.grid.Panel',
{
store: store,
columns: [
{
text : 'One',
width : 75,
dataIndex: 'one',
field : 'textfield'
},
{
text : 'Two',
width : 75,
dataIndex: 'two',
field : 'textfield'
},
{
text : 'Three',
width : 75,
dataIndex: 'three',
field : 'textfield'
}
],
height: 300,
width: 500,
renderTo: Ext.getBody(),
plugins: [editor]
});
});




HELPFUL INFORMATION


Link to older post:

http://www.sencha.com/forum/showthread.php?137290-how-to-get-correct-value-in-a-cell-edit-after-the-record-was-updated-manually&p=616050#post616050

stevil
22 Jun 2011, 3:59 AM
But the value to be edited in column2 is still 1.
If you leave it and come back it show correct (err 3 since column two also fires the edit event )

So, I read your message as indicating that you see the correct values getting into the record, but not immediately displaying. Is that correct? Also, by "leave it and come back", what do you mean (clicking a different row and then back)? I know that there are a couple of bugs being worked in CellEditing, and am wondering if this somehow might be related?

stevil

MHjerpe
22 Jun 2011, 4:32 AM
An edit listener on all cells.. in Cell-1 edit listener I update the value on the next cell (cell-2) based on the value in cell-1 .. and leaving the first cell (cell-1) with TAB key. Then when in next cell (cell-2) it displays the old value... not the one who got updated..
Yes if I leave the next cell (cell-2) to another row.. or another cell it displays the new value as it should in cell-2.

Yes correct values is going in the record. But they are not displayed when entering via TAB key.

stevil
22 Jun 2011, 5:04 AM
I know that they're working on an issue for me (intra-row change of focus with cell editing) where I enter a value in a row, then click a button I've rendered in the next column - the button won't fire unless I click a second time, OR click on another row first! I wonder if there's something in CellEditing that's eating an event within the row...

stevil

MHjerpe
22 Jun 2011, 5:18 AM
Sounds like it can be the same issue.. Hope they fix it..

stevil
22 Jun 2011, 5:23 AM
me too - i was fortunately able to isolate a test case for them that duplicates it cleanly, so here's to hoping!

stevil

mike.estes
23 Jun 2011, 1:27 PM
thanks for the report, we've just introduced a new bug template that will help us migrate bugs from the forums to our bug tracker. Could you please update your ticket to follow this template (http://www.sencha.com/forum/showthread.php?138165-How-to-report-a-bug) so that we can address it faster?

MHjerpe
4 Jul 2011, 1:09 AM
jsakalos knows whats going on.. pull the wires.. please.. :)

stevil
4 Jul 2011, 3:24 AM
@mhjerpe,

Everything I've submitted or reformatted with the bug template is being addressed, or at least has been acknowledged quickly. I know it's not perfect, but it might be worth a shot.

stevil

MHjerpe
2 Aug 2011, 12:59 AM
Formatted as per request

MHjerpe
2 Aug 2011, 4:23 AM
Don't know if this is related.. but.. when I'm REST (XML ajax) updating.. the record. on leave of the field.. it jumps to next cell.. displays wrong value (not the one that came back from the ajax update).
And then when pressing TAB or shift TAB i get 'o is undefined' ext-all-debug.js row 17228

getKey : function(o){
return o.id;
},

This is on 4.0.5 and FF5

in Chrome i get:
Uncaught TypeError: Cannot call method 'get' of undefined ext-all-debug.js:80912
When shift tabbing back from a cell with "wrong displayed value"

Can't reproduce the error with the code in the first post.. only get this when I'm doing Ajax stuff.. to and from the store.. and edit the cells at the same time.