language.thousands
language.thousands

Hi there,
It can't get the option working even in the simpliest configuration
$('#datatable_expl').dataTable( {
"language": { "thousands": " '. "}
} );
Any Idea of what could be wrong.
NB : the more sophisticated options work nicely.
$(document).ready(function() {
$('#datatable_expl').dataTable( {
"language": { "thousands": " '. "},
"columnDefs": [
{ "targets": [ 2 ],
"visible": false,
"searchable": false },
{ "targets": [ 5 ],
"sortable": false,
"visible": true
}
]
} );
} );
Thank you in advance
JAcques
Answers
Thanks for your question - however, per the forum rules can you link to a test case showing the issue please. This will allow the issue to be debugged.
Information on how to create a test page, if you can't provide a link to your own page can be found here.
Thanks,
Allan
Thank you for your quick return Allan.
Here is a fiddle : http://jsfiddle.net/f63e3ep6/11/
Initialy I thought some js or css were missing on my machine. But as a matter of fact it is also weird on fiddle.
some more info :
"infoFiltered": "(filtered from MAX total entries)",
"info": " START to END of TOTAL entries"
are working well,
but "decimal" and "thousands" don't work.
Thank you in advance
Jab
Hi Allan
fiddle : http://jsfiddle.net/f63e3ep6/11/ to fiddle : http://jsfiddle.net/f63e3ep6/19/
for the various tests I did.
Thank you in adavance
JAcques
Oh I see - you want to modify the data for the output? You need to use a renderer for that.
Allan
Thank You. I will try that.
In the doc I didn't understand that language.thousands was for the reading and that I should use a renderer for the formating of the output.
Thank you
Jab
Thanks for pointing that out - I'll update the documentation to clarify this point!
Allan
Thank you Allan,
Renderer works fine in the "declaration" part :
{ "targets": [ 4 ,5,6,7,8],
"render": $.fn.dataTable.render.number( "'", ".", 0),
"sortable": false,
"visible": true }
But how can I use this function on a specific variable expl :
X = 12345* 1234 ;
Y = X.fn.dataTable.render.number( "'", ".", 0) ; // this doesn't work...
I can't find out the exact syntax to call the render.number function
Thank you and bravo for your nice work on datatables
Best regards
JAb
You want to use the DataTables number renderer outside of DataTables? You could use:
This is the source for the renderer.
Allan
Thank you Allan
Will try that asap.
Best regards
JAB