Code: Select all
var allcells = document.getElementsByTagName('tr');
function tr_mouseover(tr) {
if (!tr.jlatched) tr.className = 'jover';
}
function tr_mouseoutnormal(tr) {
if (!tr.jlatched) tr.className = 'jnormal';
else tr.className = 'jlatched';
}
function tr_mouseouturgent(tr) {
if (!tr.jlatched) tr.className = 'jurgent';
else tr.className = 'jlatched';
}
function tr_mouseoutoverdue(tr) {
if (!tr.jlatched) tr.className = 'joverdue';
else tr.className = 'jlatched';
}
function tr_mouseout(tr) {
if (!tr.jlatched) tr.className = 'jout';
else tr.className = 'jlatched';
}
function tr_clicknormal(tr) {
var c = 0;
while (cell = allcells.item(c++))
// the problem is on the following line on each of the following functions.
if (cell != tr) {
cell.className = 'jnormal'; cell.jlatched = false;
}
else {
tr.className = 'jlatched'; tr.jlatched = true;
}
}
function tr_clickurgent(tr) {
var c = 0;
while (cell = allcells.item(c++))
if (cell != tr) {
cell.className = 'jurgent'; cell.jlatched = false;
}
else {
tr.className = 'jlatched'; tr.jlatched = true;
}
}
function tr_clickoverdue(tr) {
var c = 0;
while (cell = allcells.item(c++))
if (cell != tr) {
cell.className = 'joverdue'; cell.jlatched = false;
}
else {
tr.className = 'jlatched'; tr.jlatched = true;
}
}The JS would appy to the following PHP script:
Code: Select all
print "<tr class='joverdue'
onmouseover='tr_mouseover(this)'
onmouseout='tr_mouseoutoverdue(this)'
onclick='tr_clickoverdue(this)(top.itemdetail.location="jobdetails.php?job_id=$row[job_id]")'>";
print "<td class='jobstable' width='50'>$row[job_id]</td>";
print "<td class='jobstable' width='100'>$row[cust_name]</td>";
print "<td class='jobstable'>$row[job_notes]...</td>";
print "<td class='jobstable' width='65'>$row[job_start]</td>";
print "</tr>";
}
print "<tr class='jurgent'
onmouseover='tr_mouseover(this)'
onmouseout='tr_mouseouturgent(this)'
onclick='tr_clickurgent(this)(top.itemdetail.location="jobdetails.php?job_id=$row[job_id]")'>";
print "<td class='jobstable' width='50'>$row[job_id]</td>";
print "<td class='jobstable' width='100'>$row[cust_name]</td>";
print "<td class='jobstable'>$row[job_notes]...</td>";
print "<td class='jobstable' width='65'>$row[job_start]</td>";
print "</tr>";
}http://www.idealoffices.plus.com/tr_row_test.html
WaDaYaThink?[/url]