Highlight row on miss-match of data in columns

Highlight row on miss-match of data in columns

ravi119ravi119 Posts: 2Questions: 0Answers: 0
edited February 2012 in General
I have a table comprising 5 columns and there are 3 columns having quantity field.
Now i want to highlight those rows in which quantities are not equal.
So i have written a some code in [code]fnInitComplete[/code] method.
[code]

$('#<%=gvwRecon.ClientID%> tr ').each(function () {
var quantity1 = parseInt($(this).find('td:nth-child(7)').text());
var quantity2 = parseInt($(this).find('td:nth-child(8)').text());
var quantity3 = parseInt($(this).find('td:nth-child(9)').text());

if (isNaN(quantity1)) {
quantity1 = 0;
}
if (isNaN(quantity2)) {
quantity2 = 0;
}
if (isNaN(quantity3)) {
quantity3 = 0;
}

if ((quantity1 == quantity2) || (quantity1 != quantity3) || (quantity2 != quantity3)) {
$(this).css('background-color', '#FFC587');
}
});
[/code]

but this code is not working when i change the page.

Replies

  • ravi119ravi119 Posts: 2Questions: 0Answers: 0
    Thanks for not giving any reply.

    Problem solved
    write the code in function fnDrawCallBack.
This discussion has been closed.