Hi Team,
I was looking for samples and previous forum posts but I didn't find, I would like to know how add a conditional cell class but based on page input value.
Example: I have a page with the grid that displays data, and a filter in the top with a date interval.
Goal: I would like to highlight some cells that contain dates within the filtered interval.
How I can implement this feature? This is similar with the colorRenderer available on the Sample however the values to apply the class would be dynamic or passed as input.
Any idea how to achieve this?
Thank you,
Daniel Martins
Hi Daniel Martins
Your solution is correct!
We can't add parameters to OSCellRenderer, and considering the grid is rendered by javascript we need to call Range Slider parameters by javascript too.
Don't know if you called the grid.refresh function to apply the CSS classes, but if you don't I prepared a sample for you showing how to do it.
Regards
Ricardo Valim
While I don't get a cleaner solution, I attach one workaround that is to get the input values by class name in the script.
In the sample attached I am using the Range Slider.
Hi Ricardo,
Thank you for having a look at this.
I didn’t call the grid.refresh do you have a sample?
Maybe I forgot to add the attachment, sorry. Here it goes again. =)
Thank you!
My sample is also now available attached.
For future readers, it seems that there is now a way easier way to do this.
See the documentation
Hi @Mark Baijens
This post is about the Traditional Web version and the link you shared is for the Reactive version so not the right one. For Traditional you can find the sample here but there's not the same use case for conditional formatting (even though you have use cases like "Striped style rows" that use the same principle).
Cheers,GM