mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-02-11 09:26:37 +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,
|
processing: true,
|
||||||
serverSide: true,
|
serverSide: true,
|
||||||
colReorder: {
|
colReorder: {
|
||||||
fixedColumnsLeft: 2
|
fixedColumnsLeft: 2,
|
||||||
|
realtime: false
|
||||||
},
|
},
|
||||||
destroy: true,
|
destroy: true,
|
||||||
ajax: {
|
ajax: {
|
||||||
|
@ -129,7 +130,6 @@ function dataTableInit() {
|
||||||
},
|
},
|
||||||
fnInitComplete: function(oSettings, json) {
|
fnInitComplete: function(oSettings, json) {
|
||||||
// Reload correct column order and visibility (if you refresh page)
|
// 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++) {
|
for (var i = 0; i < table.columns()[0].length; i++) {
|
||||||
var visibility = myData.columns[i].visible;
|
var visibility = myData.columns[i].visible;
|
||||||
if (typeof (visibility) === 'string') {
|
if (typeof (visibility) === 'string') {
|
||||||
|
@ -137,6 +137,7 @@ function dataTableInit() {
|
||||||
}
|
}
|
||||||
table.column(i).visible(visibility);
|
table.column(i).visible(visibility);
|
||||||
}
|
}
|
||||||
|
oSettings._colReorder.fnOrder(myData.ColReorder);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -975,9 +976,11 @@ function changeToEditMode() {
|
||||||
function initDropdown() {
|
function initDropdown() {
|
||||||
table.on('init.dt', function() {
|
table.on('init.dt', function() {
|
||||||
initNewColumnForm();
|
initNewColumnForm();
|
||||||
loadColumnsNames();
|
|
||||||
initSorting();
|
initSorting();
|
||||||
});
|
});
|
||||||
|
$('#samples-columns-dropdown').on('show.bs.dropdown', function() {
|
||||||
|
loadColumnsNames();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
initDropdown();
|
initDropdown();
|
||||||
|
|
Loading…
Reference in a new issue