Apply a css to a particular cell by knowing the exact row and column(angular 6)

Posted by: samvarth123 on 16 December 2018, 10:42 am EST

    • Post Options:
    • Link

    Posted 16 December 2018, 10:42 am EST

    How do we apply a css to a particular cell by knowing the exact row and column value.We use angular 6 with wijmo flex grid.

    Exact Requirement to be precise :Clicking on a checkbox should disable the adjacent cell value or upon change of checkbox value in a cell adjacent cell should be disabled

  • Posted 16 December 2018, 3:30 pm EST

    Hi,

    You may use formatItem event to achieve the required functionality.

    Please refer to the following code snippet and sample:

    flexgrid.formatItem.addHandler((s,e)=>{
          if(e.panel.cellType != wjcGrid.CellType.Cell){
            return;
          }
    
          if(e.panel.columns[e.col].binding == "country"){
            let item = e.panel.rows[e.row].dataItem;
    
            if(item.active){
              wjcCore.addClass(e.cell, 'active-cell');
            }else{
              wjcCore.addClass(e.cell, 'not-active-cell');
            }
          }
        });
    

    https://stackblitz.com/edit/angular-1d19nm?file=src%2Fapp%2Fapp.component.ts

    ~Sharad

  • Posted 17 December 2018, 12:06 am EST

    Thanks you very much Sharad :slight_smile: Its done and my question is answered

Need extra support?

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

Learn More

Forum Channels