Javascript code for text color and background color

Hi Everyone,

Does anyone have a javascript code to let me change text and background color and a record is = to x (something)?

Thanks!

It is possible to do this based on connected objects up to a point - you just have to have a Text Formula or Equation field in the record to pull the information into your table via the connection.

Hi,

 

Yes you can use below JQuery Code to do that

 

var item ;
$(document).on('knack-view-render.view_xyx', function (event, scene) {
var data = Knack.models['view_xyz'].data.models;
for (x = 0; x < data.length; x++) {
item = data[x].attributes;
if(item.field_123=="Conditions")
{
$("#"+item.id).css("background-color","#eee");

}
}
});

 

Regards,

Sunny Singla

ssingla1985@gmail.com

I cant do that with connected objects as Knack doesnt have support at this moment. So I need to use custom javascript code to do the trick...

If I understand your meaning, you can already do this with Display rules (at least for Tables) - for example:

 

Is done by setting the same display rule for each of the fields in the table:

 

(I chose to leave the column with the edit button un coloured)