Jan 28, 2009, 7:05 AM
Selectin Grid Rows and Delay Ajax Event
I have a Grid showing lines which are a summary of more detailed information. I know how to display the detailed information that I want to show using the CellClick Ajax event.
I would like to do it instead using the SelectionModel as below
<ext:GridPanel ID="searchGrid" runat="server"
StoreID="searchStore"
Title="Employees"
Header="true"
AutoExpandColumn="Location"
AutoWidth="true"
AutoHeight="false" StripeRows="true" Height="300">
<ColumnModel ID="ColumnModel1">
<Columns>
<ext:Column ColumnID="EmployeeID" Header="ID" Sortable="true" DataIndex="EmployeeID" MenuDisabled="true" Width="30" />
<ext:Column ColumnID="Surname" Header="Surname" Sortable="true" DataIndex="Surname" MenuDisabled="true" />
<ext:Column ColumnID="Forenames" Header="First Names" Sortable="true" DataIndex="Forenames" MenuDisabled="true" />
<ext:Column ColumnID="Location" Header="Location" Sortable="true" DataIndex="Location" MenuDisabled="true" />
<ext:Column ColumnID="LocationID" Header="Location ID" Sortable="true" DataIndex="LocationID" Hidden="true" />
<ext:Column ColumnID="JobTitle" Header="Job Title" Sortable="true" DataIndex="JobTitle" MenuDisabled="true" Width="150" />
<ext:Column ColumnID="JobID" Header="Job ID" Sortable="true" DataIndex="JobID" Hidden="true" />
</Columns>
</ColumnModel>
<SelectionModel>
<ext:CellSelectionModel ID="CellSelectionModel1" runat="server">
<AjaxEvents>
<CellSelect OnEvent="searchGrid_CellSelect" Delay="1000" >
<EventMask ShowMask="true" Msg="Loading details/P Change history..."/>
</CellSelect>
</AjaxEvents>
</ext:CellSelectionModel>
</SelectionModel>
<LoadMask ShowMask="true" />
<SaveMask ShowMask="true" />
</ext:GridPanel>
I have set the Delay to "1000" to delay the event for 1 second but this only delays ALL CellSelect events by 1 second, they still all fire.A user is likely to move quickly down the grid with the down arrow of the keyboard and I don't want to fire the event for each row change, only on the final row on which the user has stopped (i.e. perhaps for 1 second).
How do I stop the event firing for every row and then only fire for the last row selected?
If anyone has any ideas or has already done this I would be grateful for your suggestions.
Thanks