Skip to content
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ hr {

table {
font-size: 9pt;
width: 100% !important;
}

.table-bordered th,
Expand Down Expand Up @@ -167,6 +168,7 @@ th {
color: #333333;
font-size: 10pt;
vertical-align: bottom;
width: 100% !important;
}

td.firstcell {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,9 @@ function getDataTableCols(storageKey) {
* and executes an ajax method to load the data.
*/
function refreshTable(table, storageKey) {
// save the current scroll position of the table
var $scrollContainer = $(table).parent('.dt-scroll-body');
var currentScrollTop = $scrollContainer.scrollTop();

// Destroy the DataTable
var dataTableRef = dataTableRefs.get(table);
Expand Down Expand Up @@ -182,6 +185,8 @@ function refreshTable(table, storageKey) {
dataTableRef = createDataTable(table, storageKey);
ajaxReloadTable(dataTableRef);
dataTableRefs.set(table, dataTableRef);
// restore the scroll position
$scrollContainer.scrollTop(currentScrollTop);
}

/**
Expand Down Expand Up @@ -246,16 +251,32 @@ function refreshServerInformation(callback, table, storageKey, banner, bannerMsg
*/
function createDataTable(table, storageKey) {
var dataTableRef = new DataTable(table, {
"scrollX": true,
"autoWidth": false,
"ajax": function (data, callback) {
callback({
data: getStoredRows(storageKey)
});
},
"buttons": [{
"extend": 'colvis',
"text": '<i class="bi bi-gear"></i>',
"titleAttr": 'Columns'
"extend": 'colvis',
"text": '<i class="bi bi-gear"></i>',
"titleAttr": 'Columns',
},
{
"extend": 'spacer'
},
{
"text": 'Reset',
"titleAttr": 'Reset column selection and column order',
action: function (e, table) {
// reset column selection
table.columns().visible(true);
// reset column order
if (table.colReorder) {
table.colReorder.reset();
}
}
}],
"layout": {
"topStart": "pageLength",
Expand Down Expand Up @@ -384,5 +405,6 @@ function createDataTable(table, storageKey) {
],
"columns": getDataTableCols(storageKey)
});
//dataTableRef.columns.adjust();
return dataTableRef;
}
Loading