smeserver-manager-jsquery/root/usr/share/smanager/themes/default/public/js/sme-dataTable-setup.js

34 lines
1.1 KiB
JavaScript
Raw Normal View History

//Additional JS for dataTable usesetup in SMEServer
// Options for the initial dataTable call found here: https://datatables.net/reference/option/
$(window).on('pageshow', function(){
//alert('page show');
$('.TableSort').DataTable({
"stateSave": true,
"retrieve": true,
"responsive":true,
"language": {
"emptyTable": "No record found.",
"processing":'" style="color: rgba(42, 43, 43, 1)">Loading... ',
"error": function (xhr, error, thrown) {alert("Error occurred while loading data. Please try again.");}
},
"buttons": ['copy', 'csv', 'excel', 'pdf', 'print'],
"headerCallback": function( thead, data, start, end, display ) {
setup_table_row_buttons();
2024-12-17 17:18:29 +01:00
},
"layout": {
"topStart": 'buttons',
"topEnd": 'search',
"bottomStart": 'pageLength',
"bottomEnd": 'paging'
}
});
});
function setup_table_row_buttons(){
$(".sme-modify-button").button({"icon": "ui-icon-pencil"});
$(".sme-remove-button").button({"icon": "ui-icon-trash"});
$(".sme-password-button").button({"icon": "ui-icon-refresh"});
$(".sme-lock-button").button({"icon": "ui-icon-key"});
$(".sme-email-button").button({"icon": "ui-icon-mail-closed"});
2024-12-17 17:18:29 +01:00
}