field removal reload metadata

This commit is contained in:
yuri
2019-05-07 16:07:57 +03:00
parent 711d20f874
commit 80678c97f0
+13 -12
View File
@@ -45,19 +45,20 @@ Espo.define('views/admin/field-manager/list', 'view', function (Dep) {
var field = $(e.currentTarget).data('name');
this.confirm(this.translate('confirmation', 'messages'), function () {
this.notify('Removing...');
$.ajax({
url: 'Admin/fieldManager/' + this.scope + '/' + field,
type: 'DELETE',
success: function () {
this.notify('Removed', 'success');
var data = this.getMetadata().data;
delete data['entityDefs'][this.scope]['fields'][field];
Espo.Ui.notify(this.translate('Removing...'));
Espo.Ajax.request('Admin/fieldManager/' + this.scope + '/' + field, 'delete').then(function () {
Espo.Ui.success(this.translate('Removed'));
$(e.currentTarget).closest('tr').remove();
var data = this.getMetadata().data;
delete data['entityDefs'][this.scope]['fields'][field];
this.getMetadata().load(function () {
this.getMetadata().storeToCache();
$(e.currentTarget).closest('tr').remove();
}.bind(this),
});
}, this);
}.bind(this), true);
}.bind(this));
}.bind(this));
}
},