Angular - How can I add a Div to a selected cell?

Posted by: andrewalisa on 16 June 2021, 1:07 am EST

  • Posted 16 June 2021, 1:07 am EST

    Hello,

    I am using Angular 9.

    For Wijmo Flexgrid, I want to select 1 cell (not mutli select), and when 1 cell is selected I know the wj-state-selected gets enabled in the css.

    When I am selecting 1 cell, I want to add another div which will add another css class so I can display something inside in the cell. At this point, I am not in the Cell Edit, but I am just selecting the 1 cell.

    I would imagine I would add a div when the wj-state-selected is active/enabled. I would remove this div is the wj-multi-state-select is active/enabled and/or if the wj-state-selected is not enabled.

    What is the best way to do this in Wijmo? Sorry if I am not explaining this clearly.

  • Posted 17 June 2021, 8:51 am EST

    Can I get a response for this?

  • Posted 17 June 2021, 9:00 am EST

    Hi Andrew,

    The better way would be to use the selectionChanging and selectionChanged events of FlexGrid which provides the selected cell element of the last cell(from the selection is moved) and the latest cell element respectively. Initially you can set the selection to none using flexgrid.collectionView.currentPosition = -1.

    Please refer to the sample Demonstrating the same: https://stackblitz.com/edit/angular-nfcbqc?file=src%2Fapp%2Fapp.component.ts

    Regards,

    Ashwin

Need extra support?

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

Learn More

Forum Channels