What is the best way to set columnCssClass value conditionally in igGrid, for example based on a certain row property value?
Thanks!
We had a requirement to display some rows in the grid with strikethrough text and red color based on a certain row property.
This required setting the column template on all the columns.
Check this JS fiddle for sample implementation - https://jsfiddle.net/smfuge53/3/
Thank you!
is the template really necessary? i need to conditionally apply a css class for one column based on a true/false value in the dataset. this has to work dynamically and pick-up the change when values change.
is template the only option for that?
Hello coder,
I am glad I was able to help! I passed on your feedback and I am sure we'll have improvements there once the limitations with editing are resolved (which is actually in the pipeline).
Thank you for using Infragistics products!
Best regards,
Stamen Stoychev
Thank you, Stamen!
I only wish that all of that was properly documented in the API.
It is possible to add classes to the TD elements for a column based on a conditional template. The grid knows when it has to wrap the result in a TD and when it gets the whole markup. However, if you have editing enabled for templated columns, due to a limitation in the procedure that updates the cell contents, the new result of the template will not be applied to the TD but only to its contents. You can call dataBind after each update if this is an issue for you (provided the changes are committed first).
I am attaching a sample for your reference.