diff --git a/apps/common/main/lib/component/DataView.js b/apps/common/main/lib/component/DataView.js index 9edb115e58..59e1fbb6b1 100644 --- a/apps/common/main/lib/component/DataView.js +++ b/apps/common/main/lib/component/DataView.js @@ -476,7 +476,10 @@ define([ }, this); this.dataViewItems = []; - this.store.each(this.onAddItem, this); + var me = this; + this.store.each(function(item){ + me.onAddItem(item, me.store); + }, this); if (this.allowScrollbar) { this.scroller = new Common.UI.Scroller({ diff --git a/apps/common/main/lib/component/TreeView.js b/apps/common/main/lib/component/TreeView.js index 84c3fe8609..d6ac4c4b4b 100644 --- a/apps/common/main/lib/component/TreeView.js +++ b/apps/common/main/lib/component/TreeView.js @@ -198,7 +198,7 @@ define([ if (innerEl) { (this.dataViewItems.length<1) && innerEl.find('.empty-text').remove(); - if (opts && opts.at!==undefined) { + if (opts && (typeof opts.at==='number')) { var idx = opts.at; var innerDivs = innerEl.find('> div'); if (idx > 0)