fetchOnModelAfterRelate

This commit is contained in:
yuri
2016-03-02 13:21:19 +02:00
parent 6809181adf
commit f5239041bf
2 changed files with 10 additions and 0 deletions
@@ -30,6 +30,8 @@ Espo.define('crm:views/target-list/record/panels/relationship', 'views/record/pa
return Dep.extend({
fetchOnModelAfterRelate: true,
actionOptOut: function (data) {
if (confirm(this.translate('confirmation', 'messages'))) {
$.ajax({
@@ -40,6 +40,8 @@ Espo.define('views/record/panels/relationship', ['views/record/panels/bottom', '
readOnly: false,
fetchOnModelAfterRelate: false,
init: function () {
Dep.prototype.init.call(this);
},
@@ -138,6 +140,12 @@ Espo.define('views/record/panels/relationship', ['views/record/panels/bottom', '
this.setFilter(this.filter);
if (this.fetchOnModelAfterRelate) {
this.listenToOnce(this.model, 'after:relate', function () {
collection.fetch();
}, this);
}
var viewName = this.defs.recordListView || this.getMetadata().get('clientDefs.' + this.scope + '.recordViews.list') || 'Record.List';
this.once('after:render', function () {