I want the value td:eq(2),based on column name instead of writing it as td(2) in the below line
I want the value td:eq(2),based on column name instead of writing it as td(2) in the below line
amitkumarrath123
Posts: 1Questions: 1Answers: 0
rowCallback: function (row, dataSet, index) {
if (dataSet.creditDebitFlag == 'C') {
if(isCompanyAgreement){
$(row).find('td:eq(2)').css("background-color", "#D9FEE5");
}
else{
$(row).find('td:eq(4)').css("background-color", "#D9FEE5");
}
}
}
Answers
Assign classes to your columns (ths) in your HTML (class "labels_name" in the example below.)
Use "columnDefs" to assign the classes used in rowCallback to your tds.
Example:
and in rowCallback: