Hi,

creating a application where my requirement is when my record is saved my record show no color, or when record is approved on the other page record color is green.

i also apply the condition as per record operation.

but how to apply color in table record.

Please suggest me how to change color in table record.

Thanks in Advance.

Hi Amit,

For conditional highlighting, you may use extended properties.

If(ProjectTable.List.Current.Projects.status=Entities.ProjectStatus.Approved,"green-bg-row","")

Hi !

just adding to Kumar's answer that you can find the required CSS classes at the OutsystemsUIWeb BaseTheme, e.g.

.background-green

then just add it to the extended properties class depending on the status of your row record.

Swatantra Kumar wrote:

Hi Amit,

For conditional highlighting, you may use extended properties.

If(ProjectTable.List.Current.Projects.status=Entities.ProjectStatus.Approved,"green-bg-row","")

Hi Amit,

 Please try what my OutSystems friend Swatantra Kumar says. I think that will work perfectly.

Hi, It is not THAT simple.

A TableRecords has lots of CSS applied to it and simply applying something in the extended properties of the Row is not enough. The CSS selectors must be appropriated.

For example, if you want to show Users and set background according to the user status, you need the proper CSS.

For example, in the ROW element of the TableRecords you can put like was mentioned:

If(UserTable.List.Current.User.Is_Active = True, "green", "red")

But the CSS is not so simple as creating or using pre-defined classes...

.TableRecords .green td.TableRecords_OddLine, .TableRecords .green .TableRecords_EvenLine {
    background-color: green;
    color: white;
}
.TableRecords .red td.TableRecords_OddLine, .TableRecords .red .TableRecords_EvenLine {
    background-color: red;
    color: white;
}

The above code+CSS will result in this, in my table:

Notice that it does work for most elements, but the Email attribute is an 'a' tag (an anchor, or a link), and it requires more CSS to make it change its style:

.TableRecords .green td.TableRecords_OddLine, 
.TableRecords .green .TableRecords_EvenLine,
.TableRecords .green td.TableRecords_OddLine a, 
.TableRecords .green .TableRecords_EvenLine a, 
.TableRecords .green td.TableRecords_OddLine a:visited, 
.TableRecords .green .TableRecords_EvenLine a:visited {
    background-color: green;
    color: white;
}
.TableRecords .red td.TableRecords_OddLine, 
.TableRecords .red .TableRecords_EvenLine,
.TableRecords .red td.TableRecords_OddLine a, 
.TableRecords .red .TableRecords_EvenLine a, 
.TableRecords .red td.TableRecords_OddLine a:visited, 
.TableRecords .red .TableRecords_EvenLine a:visited{
    background-color: red;
    color: white;
}

Hope this can help.

Cheers.

Thanks to all of you...

I learn lot of your suggestions.. let me check.. and update as soon as my queries got resolved.

Eduardo Thanks for your help.. it works.

iamuramit wrote:

Eduardo Thanks for your help.. it works.

Hi, glad to hear,.

Please, consider marking the answer that helps most as the solution só others find it easily. 

Cheers. 


The Eduardo present a good  the solution. Please check it.  


Thank you