I use tree.panel.expandPath() to show specific node in the tree panel, specifying select.true and focus:true
It does the work, but the node is positioned as top or button row in visible area, depending on previous position. I want to position it in the center.
I decided to to do int inside of expandPath's call back
Code:
callback: function(success, recNode, elNode) {
let s = treepanel.getScrollable();
let scrollPos = s.getEnsureVisibleXY(s.getElement(), {
align: {
y: 'center' // can be 'start', 'center', 'end'
}
});
scrollPos.y = calculate right pos
s.scrollTo(scrollPos);
}
it turned out that getEnsureVisibleXY() does not honor align option, just doing start or end depending on previous position.
Well, tried to do my own calculation for scrollTo(). I can use getMaxUserPosition() and getClientSize(), but I need to get offset of scroller's client area, and could not find right api call to do it.
Anybody knows how to scroll the node to the center position?