Icon on value of a cell if its empty.

Icon on value of a cell if its empty.

bndaliabndalia Posts: 5Questions: 3Answers: 0

Hello everyone, I am needing to insert an icon (eg class = "fa fa-times") into the value of a cell if it is empty.
Try rendering or celldata but I have not achieved results.

I greatly appreciate your guide.
Greetings.

Answers

  • colincolin Posts: 15,240Questions: 1Answers: 2,599

    Hi @bndalia ,

    If you only care about empty cells in a specific column, you can use columns.render to change the empty string to an icon.

    If it's empty cells anywhere in a row you want to change, then the best place would be to use rowCallback to scan the data and then insert the icon if empty.

    Cheers,

    Colin

  • bndaliabndalia Posts: 5Questions: 3Answers: 0

    Thanks Colin,
    Could you show me an example of how to use column.render to achieve this?

    regards

  • colincolin Posts: 15,240Questions: 1Answers: 2,599

    Hi @bndalia ,

    Take a look at the fifth example on the columns.render page. It's doing a test for the data length, you can change that to be a test for the data, then replace it with your icon of choice,

    Cheers,

    Colin

This discussion has been closed.