From af084dacc16038717c77759428e3022ba55debde Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Wed, 14 Jul 2021 19:47:47 +0300 Subject: [PATCH] Fix Bug 51297 --- apps/common/main/lib/component/DataView.js | 5 ++++- apps/common/main/lib/component/TreeView.js | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) 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)