rawCallback color condition counter

Posts: 20Questions: 7Answers: 0

, 'rowCallback': function (nRow, nData)
{
var intVal = function (i) {
return typeof i === 'string' ?
i.replace(/[\\$,]/g, '') * 1 :
typeof i === 'number' ?
i : 0;
}
if (intVal(nData[6]) < 3.00 && intVal(nData[6]) != 0.00) {
//\$(nRow).css('background-color', '#FF0000');
\$(nRow).css('background-color', '#E74C3C');
\$(nRow).css('color', 'white');
//\$(nRow).find('td:eq(10)').css('background-color', 'red');
}
else if (intVal(nData[6]) <= 5.00 && intVal(nData[6]) != 0.00) {
//\$(nRow).css('background-color', '#FF0000');
\$(nRow).css('background-color', '#5E96FF');
\$(nRow).css('color', 'white');
//\$(nRow).find('td:eq(10)').css('background-color', 'red');
}
else if (intVal(nData[6]) > 5.00 && intVal(nData[6]) != 0.00) {
//\$(nRow).css('background-color', '#FF0000');
\$(nRow).css('background-color', '#05AC00');
\$(nRow).css('color', 'white');
//\$(nRow).find('td:eq(10)').css('background-color', 'red');
}
}

now I wanna put number of rows based on above 3 conditions... in a tr. it should also work with search.

Answers

• Posts: 14,192Questions: 1Answers: 2,404

We're happy to take a look, but as per the forum rules, please link to a test case - a test case that replicates the issue will ensure you'll get a quick and accurate response. Information on how to create a test case (if you aren't able to link to the page you are working on) is available here.

Cheers,

Colin

Sign In or Register to comment.