You can change the text and background colour of fields in grid and editable grid view applications by doing the following:
(I have used the sec_grid_sec_users application for this example)
Add the following link to the bootstrap css in onScriptInit of sec_grid_sec_users: (this works for For both Grid and Editable grid views)
[SIZE=13px]?>[/SIZE]
[SIZE=13px]<link href="//netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css" rel=“stylesheet”>[/SIZE]
[SIZE=13px]<?php[/SIZE]
Add the following code to the onRecord event of sec_grid_sec_users:
if({active} == “Y” )
{
{active} = "<label class='label label-success'>Active</label>"; // note that you can use the original field like so: [SIZE=13px]{active} = "<label class='label label-success'>[/SIZE][SIZE=13px]{active}[/SIZE][SIZE=13px]</label>";[/SIZE]
} else{
{active} = "<label class='label label-warning'>Inactive</label>";
}
Change the {active} field not to lookup values:
[ATTACH=CONFIG]n71195[/ATTACH]
Run the Application:
[ATTACH=CONFIG]n71193[/ATTACH]
The following screenshot uses the same procedure for an editable grid view. Note make sure you set the form field as a “label Field”,
and you add your script to change the text to the onLoadRecord event.
[ATTACH=CONFIG]n71196[/ATTACH]
Result:
[ATTACH=CONFIG]n71194[/ATTACH]