jQuery UI Widgets Forums Grid ensurerowvisible is not working properly

This topic contains 2 replies, has 3 voices, and was last updated by  dmausner 8 years, 8 months ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author

  • ales
    Participant

    The documentation says that ensurerowvisible method has bound index as its parameter. When the grid is sorted, then this method works like the parameter is the “visible index” of the row, for example:

    $(“#myGrid”).jqxGrid(‘ensurerowvisible’, 0); // the first rows is made visible
    $(“#myGrid”).jqxGrid(‘ensurerowvisible’, someLastIndex); // the last rows is made visible

    I would like to make a new inserted row visible that user can immediately fill in the values, but this works only when the grid is not sorted. Am I doing something wrong?

    Thank you for your response.
    Ales


    Peter Stoev
    Keymaster

    Hi Alex,

    To get the index of the last row, use the getrows method which returns array. Each array has length so ensurerowvisible should be called with length – 1 due to the fact that indexes start from 0. EnsureRowVisible will work when you pass a correct row index and btw it does not really matter whether it is sorted or filtered. Example: http://jsfiddle.net/jqwidgets/v6eT7/

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

    ensurerowvisible is not working properly #81804

    dmausner
    Participant

    Method “ensurerowvisible” behaves unexpectedly and this can be demonstrated on jsFiddle.

    Go to: http://jsfiddle.net/jqwidgets/hBM5L/
    Change line 72 so that the method tries to view row 499.
    Add the following items after line 32:
    editable:true,
    pageable:true,
    pagermode:”simple”,
    pagesize:25,
    pagesizeoptions:[25],
    pagerbuttonscount:-1,
    autorowheight:true,
    Now run the JS. Navigate to the very last row by clicking the button.
    Try to edit one of the cells in the very last row.
    The table jumps up to a random row and the edited row is off-screen. Good luck trying to edit the cell.

    Ensuring the row is on-screen for editing seems to work if the entire page is on-screen. But if the page size is larger than the window, and you attempt to edit a cell which is normally deeper on the page, its visibility is not ensured. This will always occur when autorowheight==true and the cell values have multi-line text.

    This seems to be a bug.

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.