Datatables HTML5 Reference?
Datatables HTML5 Reference?
Vorko
Posts: 12Questions: 2Answers: 0
I have been trying to migrate all my Javascript initialization into HTML5 properties. Sadly there is very limited reference to do so. Just this:
DataTables example - HTML5 data-* attributes - cell data
DataTables example - HTML5 data-* attributes - table options
Would someone have a real reference? I am indeed trying to use (among other things) the equivalent of
columnDefs: [
{ targets: [3, 4], className: 'text-center'}
],
language:{
url: 'myi18npath'
},
"stripeClasses": [],
This question has accepted answers - jump to:
Answers
The HTML5 data attributes used for the init options is here. Take note of the need to use double quotes for strings and how to handle camel case. sounds like you need a valid JSON string. Here is an example of the
language.url
andcolumnDefs
options:http://live.datatables.net/zanosuyo/1/edit
Kevin
Thank you, indeed it works
Do you know how to use also stripeClasses?
You can use that like this:
Please see example here,
Colin
Thanks for the prompt answer
Last question, how can you implement server side processing?
"processing": true,
"serverSide": true,
ajax: {
url: "customurl",
type: "post",
dataType: "json",
headers: {
'X-CSRF-Token': csrf
}
},
You'll need a stringified JSON for your
ajax
object.Allan
Thank you very much to both of you, I was able to make it work.