Flexgrid dataIndex of row is wrong when sorting

Posted by: 1071118072 on 23 October 2024, 5:54 am EST

    • Post Options:
    • Link

    Posted 23 October 2024, 5:54 am EST - Updated 23 October 2024, 6:02 am EST

    I want to find the visible row index of data item when grouping and sorting. If grouping or soring changes the order of row, the code below can not return right result.

    const dataIndex = 1
    const rowIndex = grid.rows.find(row => row.dataIndex === dataIndex).index
  • Posted 24 October 2024, 6:35 am EST

    Hi Bu,

    row. dataIndex can change based on row position and non data rows such as group headers I would suggest you to use dataItem and have an unique identifier to get the row index. Example:

    var myId= 1;
    grid.rows.find(row=>row.dataItem.id===myId).index
    
  • Posted 24 October 2024, 8:43 pm EST

    Thank you !

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels