Apr 27, 2009, 6:50 AM
[CLOSED] GridPanel is not refreshing
Hi ,
i have GridPanel with Store control.i am adding new record and saving it ,but gridpanel not reloads.if refresh page then records displayed.
i am just buinding list to store control. code as follows ...plz check it..
<ext:Panel ID="Panel3" runat="server" Border="false" Header="false" Frame="true"
Width="900" Height="475">
<Body>
<ext:Store runat="server" ID="Store1" AutoLoad="true" RemoteSort="true" OnRefreshData="Store1_RefreshData">
<Proxy>
<ext:DataSourceProxy />
</Proxy>
<Reader>
<ext:JsonReader ReaderID="buyerID">
<Fields>
<ext:RecordField Name="buyerID" />
<ext:RecordField Name="toWhomeTransPorted" />
<ext:RecordField Name="transportedAddress" />
<ext:RecordField Name="commodityName" />
<ext:RecordField Name="quantityorWeight" />
<ext:RecordField Name="value" />
<ext:RecordField Name="invoiceNo" />
</Fields>
</ext:JsonReader>
</Reader>
<AutoLoadParams>
<ext:Parameter Name="start" Value="0" Mode="Raw" />
<ext:Parameter Name="limit" Value="10" Mode="Raw" />
</AutoLoadParams>
<SortInfo Field="ToWhomeTransPorted" Direction="ASC" />
</ext:Store>
<ext:GridPanel runat="server" ID="GridPanel1" StoreID="Store1" Title="Buyers Information"
Height="300" Header="true" Icon="Lorry" StripeRows="true">
<ColumnModel ID="ColumnModel1" runat="server">
<Columns>
<ext:Column ColumnID="buyerID" Header="Buyer ID" DataIndex="buyerID" Sortable="true"
Hidden="true">
</ext:Column>
<ext:Column Header="To Whome TransPorted" DataIndex="toWhomeTransPorted" Sortable="true"
Width="150" />
<ext:Column Header="Transported Address" DataIndex="transportedAddress" Sortable="true"
Width="150" />
<ext:Column Header="Commodity Name" DataIndex="commodityName" Sortable="true" Width="100" />
<ext:Column Header="Quantity/Weight" DataIndex="quantityorWeight" Sortable="true"
Width="100" />
<ext:Column Header="Value" DataIndex="value" Sortable="true" Width="100" />
<ext:Column Header="Invoice No" DataIndex="invoiceNo" Sortable="true" Width="100" />
</Columns>
</ColumnModel>
<SelectionModel>
<ext:RowSelectionModel ID="RowSelectionModel1" runat="server" />
</SelectionModel>
<LoadMask ShowMask="true" />
<SaveMask ShowMask="true" />
<BottomBar>
<ext:PagingToolBar ID="PagingToolBar1" runat="server" PageSize="5" DisplayInfo="true"
DisplayMsg="Displaying buyers {0} - {1} of {2}" EmptyMsg="No buyers to display" />
</BottomBar>
<AjaxEvents>
<RowClick OnEvent="SaveRowID">
<ExtraParams>
<ext:Parameter Name="id" Value="params[0].getStore().getAt(params[1]).id" Mode="Raw" />
</ExtraParams>
</RowClick>
</AjaxEvents>
<Buttons>
<ext:Button ID="btnAddBuyer" runat="server" Text="Add Buyer" Icon="Add">
<AjaxEvents>
<Click OnEvent="ShowNewPopUP" Failure="Ext.MessageBox.alert('Load failed', 'Error during ajax event!');">
<ExtraParams>
<ext:Parameter Name="id" Value='ADD' Mode="Value" />
</ExtraParams>
</Click>
</AjaxEvents>
</ext:Button>
<ext:Button ID="btnUpdaetBuyer" runat="server" Text="Edit Buyer" Icon="Disk">
<AjaxEvents>
<Click OnEvent="ShowPopUP" Failure="Ext.MessageBox.alert('Load failed', 'Error during ajax event!');">
<ExtraParams>
<ext:Parameter Name="id" Value='Edit' Mode="Value" />
</ExtraParams>
</Click>
</AjaxEvents>
</ext:Button>
<ext:Button ID="DeleteButton" runat="server" Text="Delete Buyer" Icon="Delete">
<AjaxEvents>
<Click OnEvent="DeleteSelectedRecord" Success="Ext.Msg.alert('Delete', 'Deleted');">
<ExtraParams>
<ext:Parameter Name="id" Value="1" Mode="Value" />
</ExtraParams>
</Click>
</AjaxEvents>
</ext:Button>
</Buttons>
</ext:GridPanel>
</Body>
</ext:Panel>
i have GridPanel with Store control.i am adding new record and saving it ,but gridpanel not reloads.if refresh page then records displayed.
i am just buinding list to store control. code as follows ...plz check it..
<ext:Panel ID="Panel3" runat="server" Border="false" Header="false" Frame="true"
Width="900" Height="475">
<Body>
<ext:Store runat="server" ID="Store1" AutoLoad="true" RemoteSort="true" OnRefreshData="Store1_RefreshData">
<Proxy>
<ext:DataSourceProxy />
</Proxy>
<Reader>
<ext:JsonReader ReaderID="buyerID">
<Fields>
<ext:RecordField Name="buyerID" />
<ext:RecordField Name="toWhomeTransPorted" />
<ext:RecordField Name="transportedAddress" />
<ext:RecordField Name="commodityName" />
<ext:RecordField Name="quantityorWeight" />
<ext:RecordField Name="value" />
<ext:RecordField Name="invoiceNo" />
</Fields>
</ext:JsonReader>
</Reader>
<AutoLoadParams>
<ext:Parameter Name="start" Value="0" Mode="Raw" />
<ext:Parameter Name="limit" Value="10" Mode="Raw" />
</AutoLoadParams>
<SortInfo Field="ToWhomeTransPorted" Direction="ASC" />
</ext:Store>
<ext:GridPanel runat="server" ID="GridPanel1" StoreID="Store1" Title="Buyers Information"
Height="300" Header="true" Icon="Lorry" StripeRows="true">
<ColumnModel ID="ColumnModel1" runat="server">
<Columns>
<ext:Column ColumnID="buyerID" Header="Buyer ID" DataIndex="buyerID" Sortable="true"
Hidden="true">
</ext:Column>
<ext:Column Header="To Whome TransPorted" DataIndex="toWhomeTransPorted" Sortable="true"
Width="150" />
<ext:Column Header="Transported Address" DataIndex="transportedAddress" Sortable="true"
Width="150" />
<ext:Column Header="Commodity Name" DataIndex="commodityName" Sortable="true" Width="100" />
<ext:Column Header="Quantity/Weight" DataIndex="quantityorWeight" Sortable="true"
Width="100" />
<ext:Column Header="Value" DataIndex="value" Sortable="true" Width="100" />
<ext:Column Header="Invoice No" DataIndex="invoiceNo" Sortable="true" Width="100" />
</Columns>
</ColumnModel>
<SelectionModel>
<ext:RowSelectionModel ID="RowSelectionModel1" runat="server" />
</SelectionModel>
<LoadMask ShowMask="true" />
<SaveMask ShowMask="true" />
<BottomBar>
<ext:PagingToolBar ID="PagingToolBar1" runat="server" PageSize="5" DisplayInfo="true"
DisplayMsg="Displaying buyers {0} - {1} of {2}" EmptyMsg="No buyers to display" />
</BottomBar>
<AjaxEvents>
<RowClick OnEvent="SaveRowID">
<ExtraParams>
<ext:Parameter Name="id" Value="params[0].getStore().getAt(params[1]).id" Mode="Raw" />
</ExtraParams>
</RowClick>
</AjaxEvents>
<Buttons>
<ext:Button ID="btnAddBuyer" runat="server" Text="Add Buyer" Icon="Add">
<AjaxEvents>
<Click OnEvent="ShowNewPopUP" Failure="Ext.MessageBox.alert('Load failed', 'Error during ajax event!');">
<ExtraParams>
<ext:Parameter Name="id" Value='ADD' Mode="Value" />
</ExtraParams>
</Click>
</AjaxEvents>
</ext:Button>
<ext:Button ID="btnUpdaetBuyer" runat="server" Text="Edit Buyer" Icon="Disk">
<AjaxEvents>
<Click OnEvent="ShowPopUP" Failure="Ext.MessageBox.alert('Load failed', 'Error during ajax event!');">
<ExtraParams>
<ext:Parameter Name="id" Value='Edit' Mode="Value" />
</ExtraParams>
</Click>
</AjaxEvents>
</ext:Button>
<ext:Button ID="DeleteButton" runat="server" Text="Delete Buyer" Icon="Delete">
<AjaxEvents>
<Click OnEvent="DeleteSelectedRecord" Success="Ext.Msg.alert('Delete', 'Deleted');">
<ExtraParams>
<ext:Parameter Name="id" Value="1" Mode="Value" />
</ExtraParams>
</Click>
</AjaxEvents>
</ext:Button>
</Buttons>
</ext:GridPanel>
</Body>
</ext:Panel>