Added natural dynamic sorting
New attributes for sortable tables: sort-column (0 ... x) for default sort col in template and sort-direction (asc, desc) for default sort order on load
This commit is contained in:
12234
templates/Sparkle/assets/js/jquery.dataTables.js
vendored
12234
templates/Sparkle/assets/js/jquery.dataTables.js
vendored
File diff suppressed because it is too large
Load Diff
12142
templates/Sparkle/assets/js/jquery.dataTables.naturalSorting.js
vendored
Normal file
12142
templates/Sparkle/assets/js/jquery.dataTables.naturalSorting.js
vendored
Normal file
File diff suppressed because it is too large
Load Diff
12
templates/Sparkle/assets/js/main.js
vendored
12
templates/Sparkle/assets/js/main.js
vendored
@@ -21,13 +21,19 @@ $(document).ready(function() {
|
||||
});
|
||||
|
||||
// Enable datatable
|
||||
$('#sortable').dataTable({
|
||||
var sortColumn = $('#sortable').attr('sort-column');
|
||||
if (sortColumn == null) { sortColumn = "0"; }
|
||||
var sortDirection = $('#sortable').attr('sort-direction');
|
||||
if (sortDirection == null) { sortDirection = "asc"; }
|
||||
var sortTable = $('#sortable').dataTable({
|
||||
"bFilter": false,
|
||||
"bInfo": false,
|
||||
"bPaginate": false
|
||||
"bPaginate": false,
|
||||
"aaSorting": [[sortColumn, sortDirection]]
|
||||
});
|
||||
$('.nosort').unbind('click');
|
||||
|
||||
|
||||
|
||||
// this is necessary for the special setting feature (ref #1010)
|
||||
$.getQueryVariable = function(key) {
|
||||
var urlParams = decodeURI( window.location.search.substring(1) );
|
||||
|
||||
Reference in New Issue
Block a user