Hi,
I’ve customized one of my script (Script Report, standard=True) to add color when a certain condition is met. It’s working fine, but all of my field ‘Link’ are now text ie nothing happens when I click on them. Is there a way to have them back without having to re-code the href element for every Link I have?
Here’s what I have so far:
"formatter":function (value, row, column, data, default_formatter){
if (column['content'] == "Fabrication Time"){
if (data['Fabrication Time'] > 20){
value = "<span style='color:red!important;font-weight:bold;'>" + value + "</span>";
}
}
if (column['content'] == "Printing Time"){
if (data['Printing Time'] > 20){
value = "<span style='color:orange!important;font-weight:bold;'>" + value + "</span>";
}
}
if (value == null){ //without this condition, it will print 'null' on the report
value = ""
}
return value;
}
and here’s the column:
def get_columns(self, filters):
columns = [_("Project") + ":Link/Project:250"]
columns += [_("Project Name") + ":text:200"]
columns += [_("Project Manager") + ":Link/User:150"]
columns += [_("Status") + ":text:105"]
columns += [_("SubType") + ":text:105"]
columns += [_("Exp. Start Date") + ":date:90"]
columns += [_("Deposit Date") + ":date:90"]
columns += [_("Preflight") + ":text:225"]
columns += [_("PDF Approval Date") + ":date:90"]
columns += [_("Printing") + ":date:90"]
columns += [_("Inspection") + ":date:90"]
columns += [_("Preflight Time") + ":text:90"]
columns += [_("Printing Time") + ":text:90"]
columns += [_("Fabrication Time") + ":text:90"]
columns += [_("Total Time") + ":text:90"]
return columns