Forums



JavaScript UI Libraries & Blazor Components Suite โ€“ Smart UI โ€บ Forums โ€บ Data Grid โ€บ is there a way to add a class to a cell?Forum Login

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #108963
    edwardsmarkff
    Participant

    hello โ€“ i see setCellValue and setCellStyle โ€“ is there an addCellClass or something similar?

    Using something like  element.classList.add() does not appear to work as the class name is removed when the grid renders.

    also, i REALLY REALLY love using smart html elements grid! ๐Ÿ˜

    #108965
    ivanpeevski
    Participant

    Hi edward,

     

    You can use column -> cellsClassName. You can set this to a function, which is called for each cell. For example:

    cellsClassName: (index, dataField, value, rowData, row) => { if (index === 0) { return โ€˜cell-class-1โ€™ }

     

    Best Regards,
    Ivan Peevski

    Smart UI Team
    https://www.htmlelements.com/

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.