After successfully integrating the datatables on my VF page, I now have one final requirement: to display any negative values in red and bold within numerical columns. In my Salesforce implementation, I am using <apex:datatable>
for my table. Each numerical value within the table has a specific ID. Below is the JavaScript code snippet I am attempting to execute:
$('#JustTable PriorEP').each(function()
{
var valu = $(this).val();
alert(valu);
if(valu < '0')
{
$('#JustTable PriorEP').css('color', 'red');
}
}); Table id = "JustTable", column id ="PriorEP" It's not working.
Then, I revised the code as follows:
$('#JustTable PriorEP').each(function()
{
var valu = $(this).val();
if(parseInt(valu) < 0)
{
alert(parseInt(valu));
$(this).css('color', 'red');
}
});
The alert does not appear at all.