Page 1 of 1

change background color of browse rows

Posted: Mon Nov 02, 2015 12:37 am
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

Re: change background color of browse rows

Posted: Mon Nov 02, 2015 7:04 am
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

Re: change background color of browse rows

Posted: Wed Nov 04, 2015 4:53 am
by mobilemcclintic
I'll tinker with it, thanks

Re: change background color of browse rows

Posted: Wed Nov 04, 2015 10:53 pm
by admin
.

Re: change background color of browse rows

Posted: Sat Nov 07, 2015 3:49 am
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.

Re: change background color of browse rows

Posted: Mon Dec 07, 2015 11:20 pm
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.