I'm using the jQuery plugin DataTables to sort tables throughout my site. There are several tables which utilize a check-all checkbox in the header, and a checkbox in each row. Looking at the documentation and plugins, it seems the best course of action is to utilize this plugin: http://www.datatables.net/plug-ins/sorting/custom-data-source/dom-checkbox
To implement, it requires the columns option to be used:
$('.dt-check').dataTable( {
"columns": [
{ "orderDataType": "dom-checkbox" },
null,
null,
null
]
});
My problem is that the numerous tables have different counts of columns, meaning I'd need an additional script for every single different table. Is there a way to implement this where I can sort by the first column, regardless of how many columns there are?