View Full Version : [CLOSED] Refresh store after AfterRecordUpdated event

Oct 22, 2008, 6:01 AM
Hi Geoff,

I setted a Store with RefreshAfterSaving = always, OnAfterRecordUpdated, OnAfterRecordInserted, and OnRefreshData.

While I correctly use refresh data after I inserted a record in my Grid, RefreshData evet fires, after I updated a record,
click save, OnAfterRecordUpdated fires, I implemented my logic to update the business object
but OnRefreshData event DOES NOT fire! So that I can't see changes (updates) I made in the Grid.
I need to click refresh button to see made changes.

Is this normal, or am I doing something wrong?

Thank you


Oct 22, 2008, 6:17 AM

The OnRefreshData fires only if on the client side was called load/reload methods of store/grid
During AjaxEvent you can call DataBind of Store for update data on client.

If it is not helps you then please post simple example which demonstrating the problem and i'll try to help you

Oct 22, 2008, 6:45 AM
Hi Vlad,

thanx for quick response, I have this code in the Grid:

<ext:Button runat="server" ID="BT_SalvaQuest" Text="Salva" Icon="Disk">
<Click Handler="#{MyGridPanel}.save();" />

and this codebehind:

// this works fine, after this, code passes to Refresh event
protected void MyStore_AfterRecordInserted(object sender, AfterRecordInsertedEventArgs e)

// after this call, code does not pass to Refresh evet
protected void MyStore_AfterRecordUpdated(object sender, AfterRecordUpdatedEventArgs e)
this.MyStore.DataBind(); // I tried this without success

protected void MyStore_Refresh(object sender, StoreRefreshDataEventArgs e)

Thank you


Oct 22, 2008, 7:25 AM

During saving process the DataBinding doesn't allowed because it can breaks saving logic. I reproduced bug in RefreshAfterSaving property. I can suggest a few solutions while i fixing bug

1. Set RefreshAfterSaving=Always and to add DataSourceProxy to your Store


2.Another solution: Set RefreshAfterSaving=None and to add listener for Store

<CommitDone Handler="#{Store1}.reload();" />

Oct 22, 2008, 7:50 AM
Thank you Vlad,

ok! I tried both solutions, they work fine.
I adopted the first one and had the result I expected.


Nov 23, 2010, 11:24 AM

I have added column model in grid panel from code behind.

foreach (DataColumn dc in dtData.Columns)
if (count > 3)
Column co = new Column();
co.Width = Unit.Pixel(75);
co.DataIndex = dc.ColumnName;
co.Header = dc.ColumnName;
TextField c = new TextField();
c.ID = count.ToString();

I am adding Textfield as above.

Now I want to validate each textField as decimal or int.

Also total row should not be editable and color of that row should be different.

Please refer the attachement.

Nov 23, 2010, 5:25 PM

Please create a new thread because your question is not rather related to this thread.