Make number column sortable ascending only

This commit is contained in:
Brian Miyaji
2014-01-09 16:15:15 +11:00
parent 5faac4cff6
commit c6df9ebca0
2 changed files with 22 additions and 14 deletions

View File

@@ -3,7 +3,9 @@
/* Data Tables */ /* Data Tables */
.sp-data-table thead .sorting, .sp-data-table thead .sorting,
.sp-data-table thead .sorting_asc, .sp-data-table thead .sorting_asc,
.sp-data-table thead .sorting_desc { .sp-data-table thead .sorting_desc,
.sp-data-table thead .sorting_asc_disabled,
.sp-data-table thead .sorting_desc_disabled {
cursor: pointer; cursor: pointer;
} }
.sp-data-table .sorting:after, .sp-data-table .sorting:after,
@@ -21,6 +23,12 @@
.sp-data-table .sorting_desc:after { .sp-data-table .sorting_desc:after {
content: "\f140"; content: "\f140";
} }
.sp-data-table .column-number.sorting_asc {
cursor: default;
}
.sp-data-table .column-number:after {
content: "";
}
.sp-data-table .column-name .logo { .sp-data-table .column-name .logo {
vertical-align: middle; vertical-align: middle;
height: 2em; height: 2em;

View File

@@ -1,21 +1,21 @@
(function($) { (function($) {
// Data tables // Data tables
$('.sp-data-table').dataTable({ $(".sp-data-table").dataTable({
'aaSorting': [], "aaSorting": [],
'bAutoWidth': false, "bAutoWidth": false,
'bFilter': false, "bFilter": false,
'bInfo': false, "bInfo": false,
'bPaginate': false, "bPaginate": false,
'bSort': true, "bSort": true,
'oLanguage': { "oLanguage": {
'oAria': { "oAria": {
'sSortAscending': '', "sSortAscending": "",
'sSortDescending': '' "sSortDescending": ""
} }
}, },
'aoColumnDefs': [ "aoColumnDefs": [
{ 'bSortable': false, 'aTargets': [ 0 ] } { "asSorting": [ "asc" ], "aTargets": [ 0 ] }
] ]
}); });