How can I retrieve the HTMLElement of a cell in FlexGrid?

Posted by: pevezzac on 14 September 2017, 11:24 am EST

  • Posted 14 September 2017, 11:24 am EST

    Hello,

    I’d like to raise the onFormatItem event, which requires in the FormatItemEventArgs, a reference to the DOM cell that I want to format. Which API should I use to retrieve such HTMLElement given the row and column?

    Thanks!

  • Posted 14 September 2017, 11:24 am EST

    For anyone else that runs across this topic looking to get the HTMLElement of a cell, if you have a reference to the grid you can use:

    flexGrid.cells.getCellElement(row, col)

    This will get the cell from the “cells” panel. There are other GridPanel properties on FlexGrid if you need cells from other areas.

  • Posted 16 April 2020, 10:28 am EST

    Hi,

    How can we get cell element which are out of view range?

    for eg:- I have 14 columns in grid and 10 are showing for current view for others i need to scroll.

    Then i am not able to get cell element of 13 cell on click of button in first cell.

    FlexGrid.cells.getCellElement(row,col) is showing null.

  • Posted 16 April 2020, 11:10 pm EST

    Hi,

    If a cell is not displayed on the DOM (the cell is outside the viewRange), the cell’s element is not created. That is why the getCellElement returns null.

    Regards,

    Ashwin

Need extra support?

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

Learn More

Forum Channels