Possible to set DataTable sorting options via the HTML?
Possible to set DataTable sorting options via the HTML?
sm9
Posts: 27Questions: 0Answers: 0
Hi there,
I've got a website with lots of tables, and each one has different columns, column types, etc.
I'm currently calling them all with a single JS call for any table that has a class of 'sortable-table'. This is convenient and means there's less lines of code than if I had calls for every single individual table.
However, I've got half a dozen tables that I want to use aoColumns sType sorting on. In order to do this, I think I'm going to have to have an individual call for these tables in my JS, which is going to be tedious (as each of these tables has different columns).
So my question (finally) is, is it possible to specify these values via classes on the table itself? So rather than use aoColumns and '{ "sType": "uk_date" }, in my functions.js file, can I specify this via the actual table row itself, e.g. Date Submitted or similar?
Thanks,
Ste
I've got a website with lots of tables, and each one has different columns, column types, etc.
I'm currently calling them all with a single JS call for any table that has a class of 'sortable-table'. This is convenient and means there's less lines of code than if I had calls for every single individual table.
However, I've got half a dozen tables that I want to use aoColumns sType sorting on. In order to do this, I think I'm going to have to have an individual call for these tables in my JS, which is going to be tedious (as each of these tables has different columns).
So my question (finally) is, is it possible to specify these values via classes on the table itself? So rather than use aoColumns and '{ "sType": "uk_date" }, in my functions.js file, can I specify this via the actual table row itself, e.g. Date Submitted or similar?
Thanks,
Ste
This discussion has been closed.
Replies
I've often thought of writing a plug-in which will do that. Never got around to it yet though... Hopefully once v1.10 is out...
Allan
Thanks,
Stephen
Please add that Functionality, i would really appreciate that!
(Y)
Thanks!