Welcome to the nuBuilder Forums!

Register and log in to access exclusive forums and content available only to registered users.

change background color of browse rows

Post Reply
mobilemcclintic
Posts: 54
Joined: Fri Oct 23, 2015 12:34 am

change background color of browse rows

Unread post by mobilemcclintic »

Hello,
I have some read only kiosk tables (for display on TVs) that I set using php parameters and if/else if statements to manipulate css code.
Is this possible in nubuilder?
For example, I am using a custom browse code to show a view instead of a table so that my main browse form shows manipulated data from a table and it's related table.
I'd like to change the background color of a row if a field I'm not showing is either a particular value (== "value") or greater than/less than a relative date (today + 3day). Is this possible, and if so, what all is necessary to achieve this?
My js and php is amateurish.

Thank you
admin
Site Admin
Posts: 2814
Joined: Mon Jun 15, 2009 2:23 am
Been thanked: 25 times

Re: change background color of browse rows

Unread post by admin »

mobilemcclintic,

By using nuLoadBrowse() http://wiki.nubuilder.net/nubuilderv3/i ... owse.28.29 you can do what ever you like to a browse screen (with js) after it loads.

Steven
mobilemcclintic
Posts: 54
Joined: Fri Oct 23, 2015 12:34 am

Re: change background color of browse rows

Unread post by mobilemcclintic »

I'll tinker with it, thanks
admin
Site Admin
Posts: 2814
Joined: Mon Jun 15, 2009 2:23 am
Been thanked: 25 times

Re: change background color of browse rows

Unread post by admin »

.
mobilemcclintic
Posts: 54
Joined: Fri Oct 23, 2015 12:34 am

Re: change background color of browse rows

Unread post by mobilemcclintic »

If I try the below, i can change one cell
function nuLoadBrowse(){
var div = document.getElementById("row_0001_col_1");

div.style.backgroundColor="#888";
}
}

When I try this code, even with a 1tic_priority field with Urgent, nothing changes.

function nuLoadBrowse(){
if('#1tic_priority#' == 'Urgent'){
var div = document.getElementById("row_0001_col_1");

div.style.backgroundColor="#888";
}
}

My end goal, is to use 2 or more or if/and statements to control a background color and have it cycle for each row.
I really do appreciate the help.
admin
Site Admin
Posts: 2814
Joined: Mon Jun 15, 2009 2:23 am
Been thanked: 25 times

Re: change background color of browse rows

Unread post by admin »

mobilemcclintic,

You'll just need to debug it (the same way I would have to).

But if you hit F12, you can try your js in the console.

Steven.
Post Reply