mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-02-10 17:03:56 +08:00
Fix columns visability and reordering bug [SCI-779]
This commit is contained in:
parent
460ca067a2
commit
435a8d20bb
1 changed files with 6 additions and 3 deletions
|
@ -26,7 +26,8 @@ function dataTableInit() {
|
|||
processing: true,
|
||||
serverSide: true,
|
||||
colReorder: {
|
||||
fixedColumnsLeft: 2
|
||||
fixedColumnsLeft: 2,
|
||||
realtime: false
|
||||
},
|
||||
destroy: true,
|
||||
ajax: {
|
||||
|
@ -129,7 +130,6 @@ function dataTableInit() {
|
|||
},
|
||||
fnInitComplete: function(oSettings, json) {
|
||||
// Reload correct column order and visibility (if you refresh page)
|
||||
oSettings._colReorder.fnOrder(myData.ColReorder);
|
||||
for (var i = 0; i < table.columns()[0].length; i++) {
|
||||
var visibility = myData.columns[i].visible;
|
||||
if (typeof (visibility) === 'string') {
|
||||
|
@ -137,6 +137,7 @@ function dataTableInit() {
|
|||
}
|
||||
table.column(i).visible(visibility);
|
||||
}
|
||||
oSettings._colReorder.fnOrder(myData.ColReorder);
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -975,9 +976,11 @@ function changeToEditMode() {
|
|||
function initDropdown() {
|
||||
table.on('init.dt', function() {
|
||||
initNewColumnForm();
|
||||
loadColumnsNames();
|
||||
initSorting();
|
||||
});
|
||||
$('#samples-columns-dropdown').on('show.bs.dropdown', function() {
|
||||
loadColumnsNames();
|
||||
});
|
||||
}
|
||||
|
||||
initDropdown();
|
||||
|
|
Loading…
Reference in a new issue