I need to set the background color of a DataTable Column (bodyClass) based on a property of the row data. Is there any way to achieve this?
As a workaround, I can set a fixed height in the body template of the column, but the I get into trouble with the responsiveness.
Dynamic bodyClass for DataTable Column
-
- Posts: 560
- Joined: 23 Oct 2020, 09:28
Could you please check this example https://codesandbox.io/s/mnvnsc?file=/s ... ue:283-339, especially 'Quantity' column.
Thanks,
Thanks,
-
- Posts: 24
- Joined: 11 Jan 2022, 10:54
Thanks for the example and the reply. However, I would like to apply the class (dynamically) to the <td> element and not the content.
-
- Posts: 3
- Joined: 21 Dec 2020, 13:26
Thanks for the reply @tugce.kucukoglu.
I was exactly looking for the :rowClass feature to dynamically style rows, depending on the {data}.
Made my day
I was exactly looking for the :rowClass feature to dynamically style rows, depending on the {data}.
Made my day
-
- Information
-
Who is online
Users browsing this forum: No registered users and 16 guests