mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-02-06 15:05:26 +08:00
fixed bug with assigned repository items [fixes SCI-2040]
This commit is contained in:
parent
128f15f984
commit
27b7aff3ea
1 changed files with 18 additions and 5 deletions
|
@ -176,7 +176,14 @@ var RepositoryDatatable = (function(global) {
|
|||
TABLE.column(i).visible(visibility);
|
||||
TABLE.setColumnSearchable(i, visibility);
|
||||
}
|
||||
// Datatables triggers this action about 3 times
|
||||
// sometimes on the first iteration the oSettings._colReorder is null
|
||||
// and the fnOrder rises an error that breaks the table
|
||||
// here I added a null guard for that case.
|
||||
// @todo we need to find out why the tables are loaded multiple times
|
||||
if( oSettings._colReorder ) {
|
||||
oSettings._colReorder.fnOrder(myData.ColReorder);
|
||||
}
|
||||
TABLE.on('mousedown', function() {
|
||||
$('#repository-columns-dropdown').removeClass('open');
|
||||
});
|
||||
|
@ -445,15 +452,21 @@ var RepositoryDatatable = (function(global) {
|
|||
|
||||
$('#assigned-repo-records').on('click', function() {
|
||||
viewAssigned = 'assigned';
|
||||
TABLE.ajax.reload(function() {
|
||||
var promiseReload = new Promise(function(resolve) {
|
||||
resolve(TABLE.ajax.reload());
|
||||
});
|
||||
promiseReload.then(function() {
|
||||
initRowSelection();
|
||||
}, false);
|
||||
})
|
||||
});
|
||||
$('#all-repo-records').on('click', function() {
|
||||
viewAssigned = 'all';
|
||||
TABLE.ajax.reload(function() {
|
||||
var promiseReload = new Promise(function(resolve) {
|
||||
resolve(TABLE.ajax.reload());
|
||||
});
|
||||
promiseReload.then(function() {
|
||||
initRowSelection();
|
||||
}, false);
|
||||
})
|
||||
});
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue