jQWidgets Forums

jQuery UI Widgets Forums Grid Set position of scrollbar jqxGrid

This topic contains 2 replies, has 2 voices, and was last updated by  chuonchuonot 9 years, 6 months ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
  • Set position of scrollbar jqxGrid #80245

    chuonchuonot
    Participant

    Hello all!
    I am working with JqxGrid on ASP.NET. I have an issue with scrollbar. I scroll down the list of elements and select a row and then I postback the page. I implemented to keep the selected row but it’s position is not kept. I think that I must reset the position of scroll bar. How can I GET and SET it?
    Could you please give me another solution to solve this if needed?

    Thank you in advance!
    Best regards,
    Hong Phuc

    Set position of scrollbar jqxGrid #80260

    Hristo
    Participant

    Hello Hong Phuc,

    Property ready from the Grid will be helpful in this case.
    If you know to which element would like to scroll could use this method ensurerowvisible.
    This is demonstrated in the example below.
    Please take a look this: http://jsfiddle.net/jd0z46us/
    More about “How to get data from row?” could read in this article:
    http://www.jqwidgets.com/getting-the-clicked-grid-row/
    And especially in API Documentation: http://www.jqwidgets.com/jquery-widgets-documentation/documentation/jqxgrid/jquery-grid-api.htm?search=

    Best Regards,
    Hristo Hristov

    jQWidgets team
    http://www.jqwidgets.com

    Set position of scrollbar jqxGrid #80266

    chuonchuonot
    Participant

    Hello Hristo,

    Thank you a lot. I solved my issue. I have 2 grids with 2 types of selectionmode. In case of each one, I implement the following:

    – Grid A (selectionmode = singleselect):
    ready: function () {
    $(“#jqxgridA”).jqxGrid(‘ensurerowvisible’, sessionRowIndex);
    },

    With sessionRowIndex stores selection row index into session and send to client side after postback.

    – Grid B (selectionmode = checkbox):
    ready: function () {
    if (sessionRowsIndexOnGridB.length > 0) {
    var rowboundindex = $(‘#jqxgridB’).jqxGrid(‘getrowboundindex’, parseInt(sessionRowsIndexOnGridB[0], 10));
    $(“#jqxgridB”).jqxGrid(‘ensurerowvisible’, rowboundindex);
    }
    },
    With sessionRowsIndexOnGridB stores the list of selection row indexes into session and send to client side after postback.

    Thank you again. 🙂

    Best regards,
    Hong Phuc

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

You must be logged in to reply to this topic.