Selectin Grid Rows and Delay Ajax Event

  1. #1

    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
  2. #2

    RE: Selectin Grid Rows and Delay Ajax Event

    Hi,

    Use Buffer property instead Delay.


    delay : Number
    The number of milliseconds to delay the invocation of the handler after the event fires.*


    buffer : Number
    Causes the handler to be scheduled to run delayed by the specified number of milliseconds. If the event fires again within that time, the original handler is not invoked, but the new handler is scheduled in its place.



  3. #3

    RE: Selectin Grid Rows and Delay Ajax Event

    Wow - thanks for the quick reply.

    I am amazed as I did not expect an answer from a member of the development team, I thought that was reserved for members who have purchased the Professional edition.

    You guys are unbelievable.

    Thanks.

Similar Threads

  1. Replies: 29
    Last Post: Feb 01, 2012, 4:58 PM
  2. Replies: 4
    Last Post: Dec 10, 2010, 2:55 PM
  3. [CLOSED] select grid rows with ajax handler
    By hillscottc in forum 1.x Legacy Premium Help
    Replies: 3
    Last Post: May 07, 2010, 4:46 PM
  4. Replies: 1
    Last Post: Mar 16, 2010, 3:58 PM
  5. [CLOSED] Before event of a ajax event.
    By Riset in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Nov 27, 2009, 12:07 PM

Posting Permissions