jQWidgets Forums

jQuery UI Widgets Forums Grid Hovered row thrown off by sorting

This topic contains 2 replies, has 2 voices, and was last updated by  emberq 7 years, 4 months ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
  • Hovered row thrown off by sorting #97938

    emberq
    Participant

    I’m using cellhover and when the event fires and I get the hovered row, it is wrong because I’ve sorted the grid and the sorting has changed the row order. The event handler gets the row this way:

    var index = $(“#grid”).jqxGrid(‘hoveredrow’);

    If I turn off grid sorting I can get the row index properly. Is there some other way to get the row index or rowdata when I hover in a grid that has been sorted?

    Hovered row thrown off by sorting #97942

    Stanislav
    Participant

    Hello emberq,

    I would suggest you to take a look at these examples:
    getrowdatabyid
    getrowboundindex

    With one of them, you should be able to achieve your goal.

    If you need more help, please send us an example (fiddle/snippet) for a better understanding of the problem on our side, and providing a better solution.

    Best Regards,
    Stanislav

    jQWidgets Team
    http://www.jqwidgets.com/

    Hovered row thrown off by sorting #97949

    emberq
    Participant

    Thank you. The solution I used is:

    var index = $(“#grid).jqxGrid(‘hoveredrow’);
    var rows = $(“#grid).jqxGrid(‘getdisplayrows’);
    var rowData = rows[index];

    The method ‘getdisplayrows’ was key to getting the right index that takes into account grid sorting of rows.

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

You must be logged in to reply to this topic.