Optimize dataview rendering
This commit is contained in:
parent
088141efd9
commit
aee74f91b4
|
@ -424,7 +424,7 @@ define([
|
|||
innerEl.prepend(view.render().el); else
|
||||
innerEl.append(view.render().el);
|
||||
|
||||
innerEl.find('.empty-text').remove();
|
||||
(this.dataViewItems.length<1) && innerEl.find('.empty-text').remove();
|
||||
var idx = _.indexOf(this.store.models, record);
|
||||
this.dataViewItems = this.dataViewItems.slice(0, idx).concat(view).concat(this.dataViewItems.slice(idx));
|
||||
|
||||
|
|
|
@ -77,7 +77,7 @@ define([
|
|||
this.innerEl = $(this.el).find('.inner');
|
||||
|
||||
if (view && this.innerEl) {
|
||||
this.innerEl.find('.empty-text').remove();
|
||||
(this.dataViewItems.length<1) && this.innerEl.find('.empty-text').remove();
|
||||
if (this.options.simpleAddMode) {
|
||||
this.innerEl.append(view.render().el);
|
||||
this.dataViewItems.push(view);
|
||||
|
|
|
@ -195,7 +195,7 @@ define([
|
|||
if (view) {
|
||||
var innerEl = $(this.el).find('.inner').addBack().filter('.inner');
|
||||
if (innerEl) {
|
||||
innerEl.find('.empty-text').remove();
|
||||
(this.dataViewItems.length<1) && innerEl.find('.empty-text').remove();
|
||||
|
||||
if (opts && opts.at!==undefined) {
|
||||
var idx = opts.at;
|
||||
|
|
Loading…
Reference in a new issue