Language Configuration via data-*
Language Configuration via data-*
onestone
Posts: 4Questions: 1Answers: 0
Hi threre, I'm looking for a way to use HTML5 data-* attributes to configure the language of dataTables. Any chance that I can do it this way?
Cheers
This question has accepted answers - jump to:
This discussion has been closed.
Answers
You can do this using
data-language
which would contain JSON information - e.g.:data-language='{"info":"_START_ - _END_ of _TOTAL_"}'
.Example: http://live.datatables.net/zigeraxu/1/edit
Note that this requires DataTables 1.10.5+.
Allan
That's it! Appreciate your help. Thanks a lot.
I found out, that I cannot use single-quotet attributes in my environment. Is there a workaround for double-quotes?
No - that is how
jQuery.data()
operates. You need to use valid JSON in the attribute.Allan
Something like
data-language-info="_START_ - _END_ of _TOTAL_"
would be nice...