mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-02-08 16:06:03 +08:00
Merge pull request #686 from ZmagoD/zd_SCI_1371
fixes bug with sorting columns [fixes SCI-1371]
This commit is contained in:
commit
ab24414bfe
1 changed files with 2 additions and 4 deletions
|
@ -42,7 +42,6 @@ function dataTableInit() {
|
||||||
originalHeader = $('#repository-table thead').children().clone();
|
originalHeader = $('#repository-table thead').children().clone();
|
||||||
viewAssigned = 'assigned';
|
viewAssigned = 'assigned';
|
||||||
table = $('#repository-table').DataTable({
|
table = $('#repository-table').DataTable({
|
||||||
order: [[2, 'desc']],
|
|
||||||
dom: "R<'row'<'col-sm-9-custom toolbar'l><'col-sm-3-custom'f>>tpi",
|
dom: "R<'row'<'col-sm-9-custom toolbar'l><'col-sm-3-custom'f>>tpi",
|
||||||
stateSave: true,
|
stateSave: true,
|
||||||
processing: true,
|
processing: true,
|
||||||
|
@ -52,7 +51,7 @@ function dataTableInit() {
|
||||||
scrollY: '64vh',
|
scrollY: '64vh',
|
||||||
scrollCollapse: true,
|
scrollCollapse: true,
|
||||||
colReorder: {
|
colReorder: {
|
||||||
fixedColumnsLeft: $('#assigned').text().length === 0 ? 1 : 2,
|
fixedColumnsLeft: 2,
|
||||||
realtime: false
|
realtime: false
|
||||||
},
|
},
|
||||||
destroy: true,
|
destroy: true,
|
||||||
|
@ -92,7 +91,6 @@ function dataTableInit() {
|
||||||
columns: (function() {
|
columns: (function() {
|
||||||
var numOfColumns = $('#repository-table').data('num-columns');
|
var numOfColumns = $('#repository-table').data('num-columns');
|
||||||
var columns = [];
|
var columns = [];
|
||||||
|
|
||||||
for (var i = 0; i < numOfColumns; i++) {
|
for (var i = 0; i < numOfColumns; i++) {
|
||||||
var visible = (i <= 4);
|
var visible = (i <= 4);
|
||||||
var searchable = (i > 0 && i <= 4);
|
var searchable = (i > 0 && i <= 4);
|
||||||
|
@ -164,7 +162,7 @@ function dataTableInit() {
|
||||||
} else {
|
} else {
|
||||||
table.column(1).visible(true);
|
table.column(1).visible(true);
|
||||||
}
|
}
|
||||||
for (var i = 2; i < table.columns()[0].length; i++) {
|
for (var i = 1; i < table.columns()[0].length; i++) {
|
||||||
var visibility = false;
|
var visibility = false;
|
||||||
if (myData.columns[i]) {
|
if (myData.columns[i]) {
|
||||||
visibility = myData.columns[i].visible;
|
visibility = myData.columns[i].visible;
|
||||||
|
|
Loading…
Reference in a new issue