Dynamically style individual cells - on event rendering

Dynamically style individual cells - on event rendering

amiriramirir Posts: 1Questions: 1Answers: 0

This is not a problem as such, more of a question whether this is possible.

I have a datatable with a lot of numerical values.

I want to offer users the ability to select a column by clicking its header. This will set it as the "base".

For every row, it would then highlight cells below the value from the selected column in that row.

I can easily create the call back and can iterate through all the cells.

But I'm not sure how to apply the style, this is effectively rendering a cell in response to an event.

Applying a css dynamically to an individual cell won't work.

Thoughts are welcome.

Answers

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

    Hi @amirir ,

    This example here might help. It's highlighting different cells based on a mouseenter event, but you could easily change that to be a click event instead.

    Would that do the trick?

    Cheers,

    Colin

This discussion has been closed.