Wijmo flexgrid dynamic new column addition with icon as cell value

Posted by: chandrikakerur on 4 June 2024, 2:47 am EST

    • Post Options:
    • Link

    Posted 4 June 2024, 2:47 am EST - Updated 5 June 2024, 1:35 am EST

    Hi,

    the requirement :

    Scenario: based on a condition on one particular cell value of a row in flexgrid, we need to do two things :

    1. add a new column to the start of flex grid.
    2. add an icon in the cell of this newly created column corresponding to the above row.

    example :

    suppose cell[2][3] of row[2] has certain condition which needs a new column to be added.

    now we add a new column which now becomes the first column → column[0]

    now in the cell[2][0] i need to add an icon.

    how do i achieve this?

    Thanks for the help.

  • Posted 6 June 2024, 12:57 am EST

    Hello,

    To add a column at the beginning of the columns collection, you can use the “unshift” method to add a new column with the desired options to the columns array. After that, you can handle the “formatItem” event of FlexGrid to add a custom icon to your added column conditionally based on another column’s cell value. For reference, please check out the sample link below:

    https://stackblitz.com/edit/js-nnbcpf?file=index.js

    Regards

Need extra support?

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

Learn More

Forum Channels