LiveSearch and scroll to selected row

  1. #1

    LiveSearch and scroll to selected row

    When I use LiveSearch, it find and select row and this works fine on visible part of grid. But, when found row is outside, then grid won't scroll to that row. Not to criticize, but what is point to find row and then not to go there? Even click on Next button won't scroll to selected row.

    How can I implement scroll to found (selected) row after search finish?

    Just to mention, I am currently using non-buffered grid because LiveSearch has a problem with buffered, but in future, scrolling to selected row should work in both cases (non-buffered and buffered).
    Last edited by SaleCar; Mar 02, 2015 at 6:15 PM.
  2. #2
    You may be able to achieve by invoking view's focusRow, as shown below:

    gridInstance.getView().focusRow(selectedRow);
  3. #3
    Ok, but where to put that so it run after search?
  4. #4
    Store's Load listener.
  5. #5
    Nope, LiveSearch dont trigger that listener.

    This is solution:

    <Plugins>
        <ext:LiveSearchGridPanel runat="server">
            <Listeners>
                 <Search Handler="if(count>0) {App.Grid.getView().focusRow(App.Grid.getStore().indexOf(App.Grid.getSelectionModel().getSelection()[0]));}" />
            </Listeners>
        </ext:LiveSearchGridPanel>
      <%--<ext:BufferedRenderer runat="server"  />--%>
    </Plugins>
    You should update examples explorer, its pointless to search something and then just wrote "I found it" and not to go there.
  6. #6
    Not good.

    Grid\Plugins\LiveSearchGridPanel\Listeners\Search Handler fires on search but not fires when clicking on Next/Previous buttons. When there is more then one result-rows, when click on Next button, grid select next found row but scroll position remains the same.

    Because there is no button listener, it is better to put focus command to

    Grid\SelectionModel\Listeners\SelectionChange Handler

Similar Threads

  1. LiveSearch selection
    By SaleCar in forum 3.x Help
    Replies: 2
    Last Post: Jan 09, 2015, 9:03 PM
  2. Replies: 2
    Last Post: Jan 07, 2015, 7:07 PM
  3. [CLOSED] Livesearch selected item
    By CarWise in forum 2.x Legacy Premium Help
    Replies: 2
    Last Post: Apr 01, 2014, 8:33 AM
  4. [CLOSED] TreePanel scrollbar does not scroll to selected node
    By PoloTheMonk in forum 1.x Legacy Premium Help
    Replies: 13
    Last Post: Feb 09, 2012, 11:30 AM
  5. [CLOSED] How to scroll to selected row
    By tansu in forum 1.x Legacy Premium Help
    Replies: 8
    Last Post: May 17, 2009, 3:55 PM

Posting Permissions