I have a table inside a ClientTemplate which has a <tr id="trFeeder"> which I want to set the background colour in the OnClientDataBound but I can't work out the syntax - javascript really isn't my forte.
If I use $get then only the first instance of the <tr> is changed.
function OnClientDataBound(sender, args) {
var undefined = void (0)
var gantt = sender._widget;
gantt.element.find(".rgtTask ").each(function (e) {
var dataItem = gantt.dataSource.getByUid($(this).attr("data-uid"));
// this works for the entire control
if (dataItem.shortages_Exist == false) {
this.style.backgroundColor = "#D8FF96";
this.style.color = "#000000";
} else {
this.style.backgroundColor = "#9f9";
this.style.color = "#000000";
}
//can't get the syntax to change the trFeeder in the table/tr
if (dataItem.operation_No != undefined) {
if (dataItem.operation_No != "") {
if (dataItem.setup_On_Feeder == true) {
sender.$get("trFeeder").style.backgroundColor = "#FFFFFF";
//$get("trFeeder").style.backgroundColor = "#FFFFFF";
} else {
sender.$get("trFeeder").style.backgroundColor = "#CCCCCC";
//$get("trFeeder").style.backgroundColor = "#CCCCCC";
}
}
}
this.style.backgroundImage = 'none';
});
}