numbers do not sort correctly when using local array data source
Numbers do not sort correctly when using local array data source. Using the source below you'll notice that the numbers do not sort correctly. Values less than 10 do not sort above numbers greater than 10.
$gridData = array();
foreach( $players as $playerID => $playerName )
{
$floatNum = mt_rand(0, 10000) / 100;
$data = array();
$data['Number'] = $floatNum;
array_push($gridData, $data);
}
$dg = new C_DataGrid($gridData);
$dg->enable_search(true);
$dg->set_caption('Stats');
$dg->set_row_color('#2F3C4E', 'transparent', 'transparent');
$dg->set_pagesize( sizeof($gridData) );
$dg->set_col_format('Number', 'number', array("thousandsSeparator" => ",", "decimalSeparator" => ".", "decimalPlaces" => '2', "defaultValue" => '0.00'));
$dg->enable_rownumbers(true);
$dg->set_dimension(950, '100%');
$dg->display();
8
votes
Chad
shared this idea
-
thecottages commented
+1 Even when the number is set to format as integer the column is sorted as a string when you click the column header
-
Stanley Liu commented
+1 - We also got this Problem ...
-
Futureweb OG commented
+1 - We also got this Problem ...