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
1690
Scrolling in igGrid
posted

Hi,

Is it possible to scroll igGrid to specific row by JavaScript ?

Thanks,

Ed

Parents
  • 24671
    Suggested Answer
    posted

    Hi,

    yes it is possible. I hope this snippet works for you:

    $("#grid1_scroll").scrollTop($("#grid1").find("tr > td:contains('323')").first().position().top);

    it will scroll to the row where the first TD text has "323" in it. Similarly, you can use other selectors. if you have primaryKey set in the grid, it is even more straightforward:

    $("#grid1_scroll").scrollTop($("#grid1").find("tr[data-id='<primary key value>']").first().position().top);

    We plan to add this to the grid API in the future. Hope it helps. Thanks,

    Angel


Reply Children