Read options from HTML attributes
Read options from HTML attributes

We use DataTables 1.10 for quite a number of tables in a Plone site (HTML generated by TAL templates); in some of them, we use HTML attributes to configure specific options, e.g. an aaSorting
attribute (old name from DataTables 1.9, I know) which can take values like 0,asc;7,desc
for the order
option.
Currently, we have an own function we call to check for those attributes, and which in turn calls the .dataTable
method.
Is there perhaps a better way?
I could imagine to use a callback function which inspects the HTML table object and updates the given options;
this function could be applied by updating the defaults.
This question has an accepted answers - jump to answer
Answers
Hi @nummer5 ,
The table can accept HTML5 attributes, see examples here and here. Is that what you're looking for?
Cheers,
Colin
Yes, this will do; thank you.