Add function to turn a set of visible columns into a settings string for saving to session

This commit is contained in:
Oliver Walters 2020-08-28 10:50:43 +10:00
parent 86e675dbbd
commit 9c2e959ab0

View File

@ -80,6 +80,21 @@ function reloadTable(table, filters) {
} }
function visibleColumnString(columns) {
/* Generate a list of "visible" columns to save to file. */
var fields = [];
columns.forEach(function(column) {
if (column.switchable && column.visible) {
fields.push(column.field);
}
});
return fields.join(',');
}
/* Wrapper function for bootstrapTable. /* Wrapper function for bootstrapTable.
* Sets some useful defaults, and manage persistent settings. * Sets some useful defaults, and manage persistent settings.
*/ */