language.thousands

language.thousands

jab_syzjab_syz Posts: 7Questions: 1Answers: 0

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

  • allanallan Posts: 63,230Questions: 1Answers: 10,417 Site admin

    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

  • jab_syzjab_syz Posts: 7Questions: 1Answers: 0

    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.

  • jab_syzjab_syz Posts: 7Questions: 1Answers: 0

    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

  • jab_syzjab_syz Posts: 7Questions: 1Answers: 0

    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

  • allanallan Posts: 63,230Questions: 1Answers: 10,417 Site admin

    Oh I see - you want to modify the data for the output? You need to use a renderer for that.

    Allan

  • jab_syzjab_syz Posts: 7Questions: 1Answers: 0

    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

  • allanallan Posts: 63,230Questions: 1Answers: 10,417 Site admin

    Thanks for pointing that out - I'll update the documentation to clarify this point!

    Allan

  • jab_syzjab_syz Posts: 7Questions: 1Answers: 0

    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

  • allanallan Posts: 63,230Questions: 1Answers: 10,417 Site admin

    You want to use the DataTables number renderer outside of DataTables? You could use:

    X = 12345* 1234 ;
    Y = $.fn.dataTable.render.number( "'", ".", 0) ;
    
    Y.display( X );
    

    This is the source for the renderer.

    Allan

  • jab_syzjab_syz Posts: 7Questions: 1Answers: 0

    Thank you Allan
    Will try that asap.
    Best regards
    JAB

This discussion has been closed.