Add option to make tables sortable and responsive

This commit is contained in:
Brian Miyaji
2014-03-22 14:55:34 +11:00
parent 1b6d483b96
commit ce292db5cd
6 changed files with 91 additions and 25 deletions

View File

@@ -24,22 +24,25 @@ function viewport() {
/* Data Tables */
if (viewport().width > 640) {
$(".sp-league-table, .sp-event-statistics, .sp-player-list").dataTable({
"aaSorting": [],
"bAutoWidth": false,
"bFilter": false,
"bInfo": false,
"bPaginate": false,
"bSort": true,
"oLanguage": {
"oAria": {
"sSortAscending": "",
"sSortDescending": ""
}
},
"aoColumnDefs": [
{ "sType": "numeric", "aTargets": [ 0 ] },
]
$(".sp-league-table, .sp-event-statistics, .sp-player-list").each(function() {
sort = $(this).hasClass("sp-sortable-table");
$(this).dataTable({
"aaSorting": [],
"bAutoWidth": false,
"bFilter": false,
"bInfo": false,
"bPaginate": false,
"bSort": sort,
"oLanguage": {
"oAria": {
"sSortAscending": "",
"sSortDescending": ""
}
},
"aoColumnDefs": [
{ "sType": "numeric", "aTargets": [ 0 ] },
]
});
});
}