I work with TreeTable. When the button is pressed, I want to expand the elements and select one of the elements inside the parent elements. But also I want to scroll the selected item. If the element is visible (all parent elements are extended), everything works fine. But if it is not visible at first (some parent elements are minimized), scrolling starts from the nearest visible parent.
My code looks something like this:
testButton.addListener(new Button.ClickListener() {
public void buttonClick(ClickEvent event) {
ItemId parentId = selectedItem.getParent();
while (parentId ! = null) {
treeTable.setCollapsed(parentId , false);
parentId = parentId.getParent();
}
treeTable.select(selectedItem);
treeTable.setCurrentPageFirstItemId(selectedItem);
}
});
Is there any solution for scrolling to the selected item and not to the nearest visible parent of the selected item?
Thanks in advance.
source
share