Updating datatables server-side-paging module

revert-70aa11f8
dilanua 8 years ago
parent 9e9f3e859a
commit 4fe79be5f8

@ -72,13 +72,13 @@ $.fn.datatables_extended_serverside_paging = function (settings , url, dataFilte
responsive: false, responsive: false,
autoWidth: false, autoWidth: false,
dom:'<"dataTablesTop"' + dom:'<"dataTablesTop"' +
'f' + 'f' +
'<"dataTables_toolbar">' + '<"dataTables_toolbar">' +
'>' + '>' +
'rt' + 'rt' +
'<"dataTablesBottom"' + '<"dataTablesBottom"' +
'lip' + 'lip' +
'>', '>',
language: { language: {
searchPlaceholder: options.placeholder, searchPlaceholder: options.placeholder,
search: '' search: ''
@ -103,17 +103,18 @@ $.fn.datatables_extended_serverside_paging = function (settings , url, dataFilte
); );
column column
//.search(val ? '^' + val + '$' : '', true, false) //.search(val ? '^' + val + '$' : '', true, false)
.search(val ? val : '', true, false) .search(val ? val : '', true, false)
.draw(); .draw();
if (filterColumn.eq(column.index()).hasClass('data-platform')) { if (filterColumn.eq(column.index()).hasClass('data-platform')) {
if (val == null || val == undefined || val == "") { if (!val) {
$("#operation-bar").hide(); $("#operation-bar").addClass("hidden");
$("#operation-guide").show(); $("#operation-guide").removeClass("hidden");
} else { } else {
$("#operation-guide").hide(); $("#operation-guide").addClass("hidden");
$("#operation-bar").show(); $("#operation-bar").removeClass("hidden");
//noinspection JSUnresolvedFunction
loadOperationBar(val); loadOperationBar(val);
} }
} }
@ -141,13 +142,9 @@ $.fn.datatables_extended_serverside_paging = function (settings , url, dataFilte
var title = filterColumn.eq(column.index()).attr('data-for'); var title = filterColumn.eq(column.index()).attr('data-for');
$(filterColumn.eq(column.index()).empty()).html('<input type="text" class="form-control" placeholder="Search ' + title + '" />'); $(filterColumn.eq(column.index()).empty()).html('<input type="text" class="form-control" placeholder="Search ' + title + '" />');
//noinspection SpellCheckingInspection
filterColumn.eq(column.index()).find('input').on('keyup change', function () { filterColumn.eq(column.index()).find('input').on('keyup change', function () {
column.search($(this).val()).draw(); column.search($(this).val()).draw();
if ($('.dataTables_empty').length > 0) {
$('.bulk-action-row').addClass("hidden");
} else {
$('.bulk-action-row').removeClass("hidden");
}
}); });
} }
@ -173,13 +170,13 @@ $.fn.datatables_extended_serverside_paging = function (settings , url, dataFilte
* append advance operations to list table toolbar * append advance operations to list table toolbar
*/ */
$('.dataTable.list-table').closest('.dataTables_wrapper').find('.dataTablesTop .dataTables_toolbar').html('' + $('.dataTable.list-table').closest('.dataTables_wrapper').find('.dataTablesTop .dataTables_toolbar').html('' +
'<ul class="nav nav-pills navbar-right remove-margin" role="tablist">' + '<ul class="nav nav-pills navbar-right remove-margin" role="tablist">' +
'<li><button data-click-event="toggle-selectable" class="btn btn-default btn-primary select-enable-btn">Select</li>' + '<li><button data-click-event="toggle-selectable" class="btn btn-default btn-primary select-enable-btn">Select</li>' +
'<li><button data-click-event="toggle-selected" id="dt-select-all" class="btn btn-default btn-primary disabled">Select All</li>' + '<li><button data-click-event="toggle-selected" id="dt-select-all" class="btn btn-default btn-primary disabled">Select All</li>' +
'<li><button data-click-event="toggle-list-view" data-view="grid" class="btn btn-default"><i class="fw fw-grid"></i></button></li>' + '<li><button data-click-event="toggle-list-view" data-view="grid" class="btn btn-default"><i class="fw fw-grid"></i></button></li>' +
'<li><button data-click-event="toggle-list-view" data-view="list" class="btn btn-default"><i class="fw fw-list"></i></button></li>' + '<li><button data-click-event="toggle-list-view" data-view="list" class="btn btn-default"><i class="fw fw-list"></i></button></li>' +
'<li><button class="btn btn-default" data-toggle="dropdown"><i class="fw fw-sort"></i></button>' + dropdownmenu[0].outerHTML + '</li>' + '<li><button class="btn btn-default" data-toggle="dropdown"><i class="fw fw-sort"></i></button>' + dropdownmenu[0].outerHTML + '</li>' +
'</ul>' '</ul>'
); );
/** /**
@ -285,5 +282,4 @@ $.fn.datatables_extended_serverside_paging = function (settings , url, dataFilte
} }
},settings) },settings)
); );
}; };

Loading…
Cancel
Save