The reason that this would occur is if you either have a blank entry in the column somewhere (i.e. the cell is empty), or if you have non-numeric data (including white space) in the column (it doesn't look like it from your PHP statement though, so I'd guess the former). Either of this will cause DataTables number detection to trip up and have it treat the column as a string.
Did it work when you defined the sType as 'numeric'? That's the "hit it with a hammer" approach :-). If you use Firebug to inspect the live DOM, perhaps that might shed some light on why DataTables is rejecting it. Failing that, then some debug in the auto detect function might be called for.
The two numbers you have in those cells certainly look correct and should be identified as numbers by DataTables. Is accurate for all rows in your table (i.e. no empty values, no while space, no commas in larger numbers for formatting etc)?
Replies
The reason that this would occur is if you either have a blank entry in the column somewhere (i.e. the cell is empty), or if you have non-numeric data (including white space) in the column (it doesn't look like it from your PHP statement though, so I'd guess the former). Either of this will cause DataTables number detection to trip up and have it treat the column as a string.
Regards,
Allan
thanks for your fast answer.
i had define the column as "numeric" and the php statement will turn every var in a number
[code]
$('#range_table').dataTable({
"sDom": 'rtip',
"aoColumns": [
{ "sType": "string" },
{ "sType": "numeric"}
],
"aaSorting": [[1, 'desc']],
"oLanguage": {
"sUrl": "../js/de_DE.txt"
},
});
[/code]
so i am not sure why this happend
Did it work when you defined the sType as 'numeric'? That's the "hit it with a hammer" approach :-). If you use Firebug to inspect the live DOM, perhaps that might shed some light on why DataTables is rejecting it. Failing that, then some debug in the auto detect function might be called for.
Regards,
Allan
tahnks for your answer.
i inspect the dom but i am not sure if this is right.
please check out the screenshot
http://img202.imageshack.us/img202/4752/datatabedoml.jpg
The two numbers you have in those cells certainly look correct and should be identified as numbers by DataTables. Is accurate for all rows in your table (i.e. no empty values, no while space, no commas in larger numbers for formatting etc)?
Thanks,
Allan