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
1490
rowById with paging?
posted

I'm trying to use the "rowById" function on a grid (with paging) with a primary key. If the Id that I am looking for is on the "current" page it finds it fine. But if it is on not on the current page it is not found. Is there a way to use "rowById" if I don't know which page the Id will be found on? I want to find the row and get the index from it so I can programmatically move to the correct page and then select that row by index and save the index off. The code I am using is simple - but doesn't work if the Id is on a different page than the current one. 

var row = $(gridId).igGrid("rowById", 123);
if (row)
 indexToSelect = row.index();

Parents
No Data
Reply
  • 15320
    Offline posted

    Hello Ryan,

    Please note that with Paging enabled, only certain number of records as specified by the pageSize properly is rendered to the user. You can get specific record from the datasource, but you can't get its DOM element if it's not rendered yet.

    If you want to know the correct page index where specific record is placed, you may find this record by primary key in the datasource and see its index which you should divide by the pageSize. The result will be the correct page index.

    If I can provide you with further assistance, please let me know.

    Regards,
    Tsanna

Children