Oct 05, 2010, 5:05 PM
Setting GridPanel datasource on button click rather than on page load
I have a grid that I'm wanting to refresh the datasource when the user clicks a button on the screen. The button is a search button that brings back results based on criteria on the screen.
I noticed that the grid only shows data based on databinding at the time of page load rather than trying to set databinding on the click of a button.
I try setting the following on the click event, but the grid still shows the data that was loaded on the page load event.
I noticed that the grid only shows data based on databinding at the time of page load rather than trying to set databinding on the click of a button.
I try setting the following on the click event, but the grid still shows the data that was loaded on the page load event.
this.Store1.DataSource = transData;
this.Store1.DataBind();
if (Ext.IsAjaxRequest) )
this.GridPanel1.RefreshView();
How can I get the grid to refresh on the click event of a button? <ext:GridPanel ID="GridPanel1"
runat="server"
StoreID="Store1"
StripeRows="true"
SelectionMemory=Enabled
Stateful=true
Title="Array Grid"
>
<SelectionModel>
<ext:RowSelectionModel ID="SearchResultSelection" runat="server" SingleSelect="True" />
</SelectionModel>
<LoadMask ShowMask="true" />
<Listeners>
<Command Handler="Coolite.AjaxMethods.GridCommand(command, this.getColumnModel().getDataIndex(colIndex), record.data.TransactionID, rowIndex )" />
<RowMouseDown Handler="Coolite.AjaxMethods.RowSelected(rowIndex);" />
<KeyDown Handler="Coolite.AjaxMethods.GridKeyDown()" />
</Listeners>
<Buttons>
<ext:Button ID="btnSearch" runat="server" Text="Search" >
<AjaxEvents>
<Click OnEvent="btnSearch2" >
</Click>
</AjaxEvents>
</ext:Button>
</Buttons>
Last edited by geoffrey.mcgill; Oct 12, 2010 at 8:41 PM.
Reason: please use [CODE] tags