Hi , i am using a datatable with progress bar but while sorting , the negative values mess up, is there any workaround for this:
-2 is coming before -6 in ascending order , this is the code:
"columns"=>[
$name=>[
"footerText"=>"Total"
],
"Serial Count"=>[
'formatValue'=>function($value,$row){
$neg_pos = abs($value);
$text_label = '<span>'.$value.' </span>';
if($value < 0) {
return $text_label . '<div class="progress" style="display:inline-flex;height:6px;width:90%;flex-direction: row-reverse">
<div class="progress-bar" style="width:' . $neg_pos . '%;background-color:red;"></div>
</div>';
}
else{
return $text_label.'<div class="progress" style="display:inline-flex;height:6px;width:90%;">
<div class="progress-bar" style="width:'.$value.'%"></div>
</div>';
}
}