Read Language Element to generate selected rows number
Read Language Element to generate selected rows number
foxmedo
Posts: 19Questions: 3Answers: 0
Hello,
I need to read the language elements to use it in function below
var countSelectedRecords = function() {
var selected = $('tbody > tr > td:nth-child(1) input[type="checkbox"]:checked', table).size();
** var text = ?????.language.GroupActions;**
if (selected > 0) {
$('.table-group-actions > span', tableWrapper).text(text.replace("_TOTAL_", selected));
} else {
$('.table-group-actions > span', tableWrapper).text("");
}
};
the idea is when user click into the checkbox i will make the count to execute a group action this why i need to get the text message from the language file (the software are multilingue)
"language": { "url": "localhost/assets/datatables/i18n/" + user_lang_code + ".json" },
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
Hi @foxmedo ,
The proper way to do this would be to use
i18n()
- you can give it a token like this:You can also get the full list of language options if you use the private data in
settings()
Cheers,
Colin
hi @colin,
i have already try this but im getting this error
Uncaught TypeError: table.i18n is not a function
i have check my datatables version using $.fn.dataTable.version i found 1.10.12
Checkout this FAQ:
https://datatables.net/faqs/index#api
Kevin
i have solve the problem using
thank you for your help