mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-09-10 23:25:31 +08:00
add visibility functionality after refresh
This commit is contained in:
parent
332b6c58da
commit
12088ebfd3
1 changed files with 7 additions and 1 deletions
|
@ -141,11 +141,17 @@ table = $("#samples").DataTable({
|
||||||
$(".sample_info").off("click");
|
$(".sample_info").off("click");
|
||||||
},
|
},
|
||||||
fnInitComplete: function(oSettings, json) {
|
fnInitComplete: function(oSettings, json) {
|
||||||
// Reload correct column order (if you refresh page)
|
// Reload correct column order and visibility (if you refresh page)
|
||||||
oSettings._colReorder.fnOrder(myData.ColReorder);
|
oSettings._colReorder.fnOrder(myData.ColReorder);
|
||||||
|
for (var i = 0; i < table.columns()[0].length; i++) {
|
||||||
|
var visibility = myData.columns[i].visible;
|
||||||
|
var vis_boolean = (visibility === "true");
|
||||||
|
table.column(i).visible(vis_boolean);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
// Enables noSearchHidden plugin
|
// Enables noSearchHidden plugin
|
||||||
$.fn.dataTable.defaults.noSearchHidden = true
|
$.fn.dataTable.defaults.noSearchHidden = true
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue