color change for a column in a table

1
0
-1

Hi, Drag and drop the table for that table i am getting the data from webservices , now I have a column name as ACTION for this I will get (Rejected, Updated, Approved,Submitted) like this now My doubt is I want to change the font color like for Rejected(Red),Updated(blue),Approved(green) etc Please help me. Thanks in Advance.

1 answer

1
0
-1

Hi,

Actually using the table widget you can only define a global style that will apply to the whole widget.

Instead I would recommend to display your data using a container widget. You can provide the container widget with a form variable that is an array. For each element of the array a new iteration of the container will be created. In the container you can add several widgets to display your data. You can access the current data information using the variable $item.

In the widget used to display the status (rejected, approved...) you can define CSS classes. By default you define static classes but you can switch to the expression editor (by clicking on the "fx" button) and type an expression such as: $item.status === "warning" ? "text-warning" : ""

My example will use Bootstrap classes to customize the CSS class associated with the widget that display the attribute "status" of my object.

I create a basic form named "testConditionnalColor" to demonstrate that: https://www.dropbox.com/s/yet0og8zyardz3s/conditionnal-color-form.bos?dl=0

Notifications