jQWidgets Forums

jQuery UI Widgets Forums Grid Auto scroll to selection after grid update

This topic contains 5 replies, has 2 voices, and was last updated by  Peter Stoev 11 years, 3 months ago.

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

  • Victor Georgiev
    Participant

    Hello,

    Thank you for the wonderful tool you provided when you created that grid!
    I have a question regarding its grouping functionality. The issue is the following: When I update the grid when a grouping is applied, the grid refreshes and the column groupings stays, but the group that was last expanded is always collapsed. In other words I’m trying to use (‘updaterow‘, rowId, data), then (‘selectrow‘), then (‘ensurerowvisible‘) and as last (‘expandgroup‘). It does not work – grouping stays (OK), group is expanded (OK), row is selected (OK), but the scroll goes on top (ISSUE).
    Now, I found I guy asking about something similar and your answer to his query was – ‘This method ensurerowvisible works when the grid is groupable but not when any groups have been applied’. Can you suggested a workaround about this?

    Thank you in advance!

    Best Regards,
    Victor Georgiev


    Peter Stoev
    Keymaster

    Hi Victor,

    Thank you for the feedback.

    As a workaround, you may use the “scrollto” method which has 2 arguments – left and top. They specify the position of the horizontal and vertical scrollbar.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com


    Victor Georgiev
    Participant

    Hi again,

    Thank you very much for the suggestion! This works well, however is there an easy way to get the scroll position before the update, so I can put it as the ‘top’ argument?

    Thank you in advance.

    Best Regards,
    Victor Georgiev


    Peter Stoev
    Keymaster

    Hi Victor,

    You can use the following:

    var position = $("#grid").jqxGrid('scrollposition');
    var top = position.top;
    

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com


    Victor Georgiev
    Participant

    Hi Peter,

    Thanks, this works as well as $(‘#jqxgrid’).jqxGrid(‘vScrollBar’).jqxScrollBar(‘value’); that I found today. And another question that I have is – is it possible to scroll to a row thorugh/by its id or something?

    Best Regards,
    Victor Georgiev


    Peter Stoev
    Keymaster

    Hi Victor,

    I would not suggest you to use internal APIs. No, it is not possible to scroll by ID.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

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

You must be logged in to reply to this topic.