Search code examples
gridcellextjs6

ExtJs 6: how to directly get specific grid cell component by known position


I have a simple grid and would like to manage some specific cell.

Here it is: https://fiddle.sencha.com/#fiddle/32q1

I know its row number and column name.

But how I can directly get cpecific cell as a component?

I need to make setEnable and setStyle to it.


Solution

  • I used the getCell method from the Ext.view.Table (https://docs.sencha.com/extjs/6.2.0/classic/Ext.view.Table.html#method-getCell)

    Your code could look like this:

        let grid = Ext.getCmp('mygrid'),
            column = grid.getView().getGridColumns()[1],
            record = grid.getStore().getAt(2),
            cell = grid.getView().getCell(record, column);
    

    Here is the Fiddle for it.