PDA

View Full Version : [CLOSED] Refreshing Grid Data



cwolcott
May 03, 2012, 2:28 PM
I am on my last step to refresh my grid because of a messagebus notification, but I have an issue with this.getView().refresh() is not refreshing my grid. The MessageBusListener is working:



<ext:GridPanel ...>
...
<MessageBusListeners>
<ext:MessageBusListener Name="refresh" Handler="alert(data); this.getView().refresh();" />
</MessageBusListeners>
</ext:GridPanel>


I have a store, view, pagingToolbar plus other items defined in the GridPanel:



<ext:GridPanel ...>
...
<ext:Store ID="ActiveUsers_Store" runat="server" RemoteSort="true" PageSize="25" onReadData="ActiveUsers_RefreshData">
<Proxy>
<ext:PageProxy />
</Proxy>
<Model> ... </Model>
<AutoLoadParams>
<ext:Paramater Name="limit" Value="25" Mode="Raw" />
<ext:Paramater Name="start" Value="0" Mode="Raw" />
</AutoLoadParams>
<Sorters>
<ext:DataSorter Property="DisplayNm" Direction="ASC" />
</Sorters>
</ext:Store>
...
<View>
<ext:GridView runat="server" LoadingText="Loading users ..." StripeRows="true" TrackOver="true" />
</View>
...
<BottomBar>
<ext:PagingToolbar ...>
...
</ext:PagingToolbar>
</BottomBar>
</ext:GridPanel>


The grid refreshes properly when I press the PagingToolbar refresh button. Do I need to do something different since I have onReadData defined for my store?

Daniil
May 03, 2012, 3:11 PM
Hi,

Well, this code

this.getView().refresh();
doesn't reload the Store.

To reload the Store please use:

this.getStore().reload();

And you don't need to call the view refresh method, it will be called automatically after store reloading.

cwolcott
May 03, 2012, 3:15 PM
Please close the thread. Now with all of this useful information you have provided over the past couple of days I will try to leave you alone to answer other customers while I develop new pages and methods. Talk to you soon.

Daniil
May 03, 2012, 3:17 PM
Ok, no problem:)