Flexgrid - access sibiling property in ItemsSource using customCellFactory

Posted by: craig.daniel on 26 March 2018, 7:13 am EST

  • Posted 26 March 2018, 7:13 am EST

    I am using a custom CellFactory and want to access another property of the row item for which the cell is being generated (so I can add a tooltip under a particular condition).

    I do not want to add this as a hidden column (as I also have a column picker which would then show this item), so I need to reference back the item within the ItemsSource.

  • Posted 27 March 2018, 6:01 am EST

    Hi,

    You can get the row instance inside a cell factory by using panel.rows property.

    Please refer to following code snippet

    
    //export class CustomCellFactory extends wjcGrid.CellFactory{
    
    
    public updateCell(panel,row,col,cell,range?,updateContent?){
    
    switch(p.cellType){
    
    case wjcGrid.CellType.Cell: 
    
    //get dataItem bound to row instance
    
    var data=panel.rows[row].dataItem;
    
    //access property
    
    var propertyInfo=data['property_name'];
    
    break;
    
    }
    
    }
    
Need extra support?

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

Learn More

Forum Channels