Localize Settings Global
Localize Settings Global
Good morning
I have an MVC project where the user can select the language of the user interface
for the supported languages I have created a file /json/datatables.hardware
every time I open a table I do this
var tmpDataTables = $ ("# tblData"). DataTable ({
"lengthMenu": [[10, 25, 50, -1], [10, 25, 50, "All"]],
language: {
url: '/json/datatables. Harrap.json'
},
and everything works fine
but I would like to centralize everything and set it only when the program starts or when the user changes language
I read that global changes can be done like this
$ .extend (true, $ .fn.dataTable.defaults, {
but I didn't understand when and where to do it
Answers
You would set the defaults before initialising the table, something like this here: http://live.datatables.net/yoveriyi/1/edit
Colin