From 2101785f411d150f5bab84a5b45062020ae6159d Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Thu, 23 Sep 2021 00:35:35 +0300 Subject: [PATCH] Fix scroll in dataview inside menu --- apps/common/main/lib/component/DataView.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/apps/common/main/lib/component/DataView.js b/apps/common/main/lib/component/DataView.js index c8c347bb1..27698f127 100644 --- a/apps/common/main/lib/component/DataView.js +++ b/apps/common/main/lib/component/DataView.js @@ -833,16 +833,18 @@ define([ focus: function(index) { $(this.el).find('.inner').addBack().filter('.inner').focus(); + var rec; if (typeof index == 'string') { if (index == 'first') { - this.selectByIndex(0, true); + rec = this.selectByIndex(0, true); } else if (index == 'last') { if (this._layoutParams === undefined) this.fillIndexesArray(); - this.selectByIndex(this._layoutParams.itemsIndexes[this._layoutParams.rows-1][0], true); + rec = this.selectByIndex(this._layoutParams.itemsIndexes[this._layoutParams.rows-1][0], true); } } else if (index !== undefined) - this.selectByIndex(index, true); + rec = this.selectByIndex(index, true); + this.scrollToRecord(rec); }, focusInner: function(e) {