rawCallback color condition counter

rawCallback color condition counter

BhavinBhattBhavinBhatt Posts: 27Questions: 9Answers: 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

  • colincolin Posts: 15,142Questions: 1Answers: 2,586

    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.