From bbb0d0d6e2bbf4c7e7128070675f6930f7de593d Mon Sep 17 00:00:00 2001 From: Alexander Trofimov Date: Wed, 4 Aug 2021 16:34:35 +0300 Subject: [PATCH] Fix Bug 51297 (#1045) Co-authored-by: Julia Radzhabova --- 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 9edb115e5..59e1fbb6b 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 84c3fe860..d6ac4c4b4 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)