Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
175
Selecting a row that is not displayed does not scroll the grid!!!
posted

I have a WebDataGrid and in a javascript function that sellects next row. When the selected row passes the visible area of the grid  the grid does not scroll up (down).  How to force the grid to scroll to show the selected row? The selection mode is set to single row.

var grid = $find("wspltSearchRes_tmpl0_uwgResults");
if (grid == null)
    return;
var rows = grid.get_rows();
var count = rows.get_length();
if (count == 0)
   return;
// TO UNSELECT A ROW
// Remove first selected row from collection
var currentSel = grid.get_behaviors().get_selection().get_selectedRows().getItem(0);
if (currentSel != null) {
    var idx = currentSel.get_index();
    grid.get_behaviors().get_selection().get_selectedRows().remove(currentSel);
    // Select row
    grid.get_behaviors().get_selection().get_selectedRows().add(grid.get_rows().get_row(idx + 1));

....

Parents
  • 33839
    Suggested Answer
    posted

    Hi,

    Selection is just visual to the user.  You have two choices to scroll the row into view.  The first would be to turn on activation and simply set the first cell of your new selected cell to be active.  This will attempt to focus it and scroll it into view.  The second would be to manually set the scroll top of the grid yourself in JS.  Personally I would suggest the first approach.  If you have difficulty, let us know.

     

    regards,
    David Young

Reply Children