Fix #16693 - Show the new column and the table structure on the same page
Signed-off-by: William Desportes <williamdes@wdes.fr>
This commit is contained in:
parent
6019680c6a
commit
157c072c3c
@ -91,12 +91,24 @@ AJAX.registerOnload('table/structure.js', function () {
|
||||
.show();
|
||||
Functions.highlightSql($('#page_content'));
|
||||
$('.result_query .alert-primary').remove();
|
||||
reloadFieldForm();
|
||||
if (typeof data.structure_refresh_route !== 'string') {
|
||||
// Do not reload the form when the code below freshly filled it
|
||||
reloadFieldForm();
|
||||
}
|
||||
$form.remove();
|
||||
Functions.ajaxRemoveMessage($msg);
|
||||
Functions.initSlider();
|
||||
Navigation.reload();
|
||||
CommonActions.refreshMain('index.php?route=/table/structure');
|
||||
if (typeof data.structure_refresh_route === 'string') {
|
||||
// Fetch the table structure right after adding a new column
|
||||
$.get(data.structure_refresh_route, function (data) {
|
||||
if (typeof data.success !== 'undefined' && data.success === true) {
|
||||
$('#page_content').append(data.message).show();
|
||||
}
|
||||
});
|
||||
} else {
|
||||
CommonActions.refreshMain('index.php?route=/table/structure');
|
||||
}
|
||||
} else {
|
||||
Functions.ajaxShowMessage(data.error, false);
|
||||
}
|
||||
|
||||
@ -159,6 +159,16 @@ class AddFieldController extends AbstractController
|
||||
Generator::getMessage($message, $sql_query, 'success')
|
||||
);
|
||||
|
||||
// Give an URL to call and use to appends the structure after the success message
|
||||
$this->response->addJSON(
|
||||
'structure_refresh_route',
|
||||
Url::getFromRoute('/table/structure', [
|
||||
'db' => $db,
|
||||
'table' => $table,
|
||||
'ajax_request' => '1',
|
||||
])
|
||||
);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user