diff --git a/client/lib/bull.js b/client/lib/bull.js index 15ada5e680..ee5c22f5ca 100644 --- a/client/lib/bull.js +++ b/client/lib/bull.js @@ -812,13 +812,15 @@ var Bull = Bull || {}; options.el = this.getSelector() + ' [data-view="'+key+'"]'; } this._factory.create(viewName, options, function (view) { + var isSet = false; if (this._isRendered || options.setViewBeforeCallback) { this.setView(key, view); + isSet = true; } if (typeof callback === 'function') { callback.call(context, view); } - if (!this._isRendered && !options.setViewBeforeCallback) { + if (!this._isRendered && !options.setViewBeforeCallback && !isSet) { this.setView(key, view); } }.bind(this)); diff --git a/client/src/views/stream/record/list.js b/client/src/views/stream/record/list.js index a703c41431..816507b067 100644 --- a/client/src/views/stream/record/list.js +++ b/client/src/views/stream/record/list.js @@ -54,9 +54,9 @@ Espo.define('views/stream/record/list', 'views/record/list-expanded', function ( noEdit: this.options.noEdit, optionsToPass: ['acl'], name: this.type + '-' + model.name, - el: this.options.el + ' li[data-id="' + model.id + '"]' + el: this.options.el + ' li[data-id="' + model.id + '"]', + setViewBeforeCallback: this.options.skipBuildRows && !this.isRendered() }, callback); - }, buildRows: function (callback) { @@ -77,12 +77,14 @@ Espo.define('views/stream/record/list', 'views/record/list-expanded', function ( callback(); } this.wait(false); + this.trigger('after:build-rows'); } }.bind(this)); } } else { if (typeof callback == 'function') { callback(); + this.trigger('after:build-rows'); } } },