Fix scroll in dataview inside menu

This commit is contained in:
Julia Radzhabova 2021-09-23 00:35:35 +03:00
parent 82aa0963ed
commit 2101785f41

View file

@ -833,16 +833,18 @@ define([
focus: function(index) { focus: function(index) {
$(this.el).find('.inner').addBack().filter('.inner').focus(); $(this.el).find('.inner').addBack().filter('.inner').focus();
var rec;
if (typeof index == 'string') { if (typeof index == 'string') {
if (index == 'first') { if (index == 'first') {
this.selectByIndex(0, true); rec = this.selectByIndex(0, true);
} else if (index == 'last') { } else if (index == 'last') {
if (this._layoutParams === undefined) if (this._layoutParams === undefined)
this.fillIndexesArray(); 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) } else if (index !== undefined)
this.selectByIndex(index, true); rec = this.selectByIndex(index, true);
this.scrollToRecord(rec);
}, },
focusInner: function(e) { focusInner: function(e) {