mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-01-06 15:40:31 +08:00
staying on same page after saving a sample; fix button disappearance when adding new column
This commit is contained in:
parent
165ec6144c
commit
ba0214d1ff
1 changed files with 6 additions and 6 deletions
|
@ -651,7 +651,7 @@ function clearAllErrors() {
|
||||||
|
|
||||||
// Restore previous table
|
// Restore previous table
|
||||||
function onClickCancel() {
|
function onClickCancel() {
|
||||||
table.ajax.reload();
|
table.draw('page');
|
||||||
|
|
||||||
changeToViewMode();
|
changeToViewMode();
|
||||||
updateButtons();
|
updateButtons();
|
||||||
|
@ -881,6 +881,11 @@ function changeToEditMode() {
|
||||||
I18n.t('samples.js.column_added') +
|
I18n.t('samples.js.column_added') +
|
||||||
'</span>');
|
'</span>');
|
||||||
|
|
||||||
|
// Preserve save/delete buttons as we need them after new table
|
||||||
|
// will be created
|
||||||
|
$('div.toolbarButtons').appendTo('div.samples-table');
|
||||||
|
$('div.toolbarButtons').hide();
|
||||||
|
|
||||||
// Destroy datatable
|
// Destroy datatable
|
||||||
table.destroy();
|
table.destroy();
|
||||||
|
|
||||||
|
@ -902,11 +907,6 @@ function changeToEditMode() {
|
||||||
$('#samples thead').empty();
|
$('#samples thead').empty();
|
||||||
$('#samples thead').append(originalHeader);
|
$('#samples thead').append(originalHeader);
|
||||||
|
|
||||||
// Preserve save/delete buttons as we need them after new table
|
|
||||||
// will be created
|
|
||||||
$('div.toolbarButtons').appendTo('div.samples-table');
|
|
||||||
$('div.toolbarButtons').hide();
|
|
||||||
|
|
||||||
// Re-initialize datatable
|
// Re-initialize datatable
|
||||||
table = dataTableInit();
|
table = dataTableInit();
|
||||||
table.on('init.dt', function() {
|
table.on('init.dt', function() {
|
||||||
|
|
Loading…
Reference in a new issue