var line_id='[@field:Orders_Serial_Number]';
var line=document.getElementById(line_id).parentNode.parentNode;
var elems = line.getElementsByTagName("td");
elems[13].style.backgroundColor="peru";elems[13].style.color="white";
}
---------------------------------
'Orders_Serial_Number' is the auto-numbered unique id. Column 13 is 'Calculated Field 2'. This works but if I add or remove any columns, then the wrong field changes color.
How do I reference Calculated Field 2 ([@calcfield:2]) in the line 'elems[13].style.backgroundColor="peru";elems[13].style.color="white";' instead of specifying the fixed column number 13?
You can post now and register later.
If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.
Question
Neole
Hello,
I have a report datapage where using javacript in an HTML block, the color code changes in a Calculated Field depending on the value of 2 fields -
---------------------------------
if(('[@calcfield:2]'-[@field:Orders_Quantity])/[@field:Orders_Quantity]> .05){
var line_id='[@field:Orders_Serial_Number]';
var line=document.getElementById(line_id).parentNode.parentNode;
var elems = line.getElementsByTagName("td");
elems[13].style.backgroundColor="peru";elems[13].style.color="white";
}
---------------------------------
'Orders_Serial_Number' is the auto-numbered unique id. Column 13 is 'Calculated Field 2'. This works but if I add or remove any columns, then the wrong field changes color.
How do I reference Calculated Field 2 ([@calcfield:2]) in the line 'elems[13].style.backgroundColor="peru";elems[13].style.color="white";' instead of specifying the fixed column number 13?
Link to comment
Share on other sites
4 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.