FlexGrid Grouping itemFormatter Issue

Posted by: mgordon on 10 January 2018, 2:33 am EST

    • Post Options:
    • Link

    Posted 10 January 2018, 2:33 am EST

    I am using the MVC version of the FlexGrid, and I am grouping the data. I also want to use the itemFormatter to customize the data in a column. I was able to do this:

    if (panel.rows[r] instanceof wijmo.grid.GroupRow) {

    } else {

    // my code here

    }

    to determine if I am in a GroupRow or not. However, the row reference is not correct, I end up getting the row for the next line in the grid. It’s like the GroupRow ends up being treated as the actual first line of data, which throws everything off. So when I attempt to get the data for row that I am on it returns then data for the next row.

    How can I use the itemFormatter for custom formatting columns within a Grouping?

  • Posted 10 January 2018, 7:27 am EST

    Here is an update after further testing. When using the Grouping function, the row information returned is invalid. If I have 2 rows of data and those rows are grouped, when I attempt to get the items data via the row, either in the itemFormatter r value or selection.row value, the row is for the next row and not the one I am on. If I have more items and additional groups, the row offset if multiplied by the number of groups. So I have 3 items in the second group, the row value for the first item in the 2nd group is actually for the 3rd item in the 2nd group.

    The issue really appears to be in the CollectionView.Items. The row values seem to be correct, but when I attempt to access the items[1] I get data for items[2].

    This is a major bug and since our subscription expired in Nov that means we won’t be able to get the bug fix without purchasing a new subscription?

  • Posted 10 January 2018, 7:45 am EST

    Here is a workaround, use the grid.rows[row].dataItem to get the correct data for the selected row.

  • Posted 10 January 2018, 7:59 pm EST

    Hi,

    GroupRow is a part of FlexGrid rowCollection. Hence, the FlexGrid rows 0th index will be GroupRow.

    You may get each row dataItem from itemFormatter using dataItem. Please refer to the following code snippet for the same:

    panel.rows[r].dataItem
    

    However, you may also detect if the row is group row or not by checking isCollapsed is undefined or not. For normal rows, this set to undefined.

    Please let us know for further queries.

    ~Manish

Need extra support?

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

Learn More

Forum Channels