DataTable - i18n() function inside constructor
DataTable - i18n() function inside constructor
pacionet
Posts: 3Questions: 1Answers: 0
I defined something like that
$.extend( true, $.fn.dataTable.defaults, {
[...]
"language": {
"url": contextPath + "/resources/i18n/jquery.datatable.messages_" + GLOBAL_LOCALE + ".json"
},
[...]
When I define a dataTable how can I access i18n function inside datatable?
var table = $('#table').DataTable({
[...]
"columns": [
{"data": "project.name"},
{"data": "project.title"},
{
"data": function (row, data, index) {
// HERE HOW CAN I INVOKE i18n() function? this.i18n('token','default') doesn't work.
}
})
This discussion has been closed.
Answers
Hi @pacionet ,
columns.data
wouldn't be the right place, it would be better to usecolumns.render
,Cheers,
Colin
Thanks but how can I access the dataTable object inside columns.render ?
Hi @pacionet ,
You could do something like this here - it's getting a table object within the
columns.render
function,Cheers,
Colin