Oct 22, 2013, 4:35 PM
[1.6] Changes aren't reflected on grid with Ext.data.Record.set('field', value)
It's a pretty small problem but it's been bugging me for a while. Let's go with a very simplified example:
Store:
I know a simple
This isn't a big deal in any extent and I know it can be done because I've done it before (I just can't remember where or how), so what's wrong here?
PS: I can't stress enough that this is a VERY simplified vision of the actual problem so there might be something in-between messing things up, but I find it to be very unlikely.
Store:
<ext:Store ID="myStore" runat="server" UseIdConfirmation="true">
<Reader>
<ext:JsonReader IDProperty="fieldId">
<Fields>
<ext:RecordField Name="myField" Type="String" />
</Fields>
</ext:JsonReader>
</Reader>
</ext:Store>
Grid: <ext:GridPanel ID="myGrid" runat="server" StoreID="myStore Width="200">
<ColumnModel>
<Columns>
<ext:Column ColumnID="myField" Header='My Field' DataIndex="myField" AutoDataBind="true" Width="180" />
</Columns>
</ColumnModel>
<SelectionModel>
<ext:RowSelectionModel ID="RowSelectionModel2" runat="server" MoveEditorOnEnter="false" SingleSelect="true" />
</SelectionModel>
</ext:GridPanel>
For simplicity's sake, let's say I have the following inside a button's listener into the grid: <Click Handler="changeRowValue(rowIndex, myGrid)" />
Javascript snippet: var newValue = 'foo';
var changeRowValue = function(rowIndex, grd){
var store = grd.getStore();
store.getAt(rowIndex).set('myField', newValue);
}
This way, the store value is updated but it won't show 'foo' in the grid.I know a simple
grd.view.refresh()
will update the grid, but it cleans the "dirt" and I'd like it dirty (that sounded nasty) to give the user feedback that the value hasn't been commited yet (you know, the small red arrow in the upper right corner).This isn't a big deal in any extent and I know it can be done because I've done it before (I just can't remember where or how), so what's wrong here?
PS: I can't stress enough that this is a VERY simplified vision of the actual problem so there might be something in-between messing things up, but I find it to be very unlikely.
Last edited by khor; Oct 22, 2013 at 5:02 PM.