-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Hey there,
Using ZK6, I've a tree inside a container (Center object from borderlayout) and when I click on a node to open it and displays its children, I want the node to be scrolled up to the top of the container.
Even if the node is already visible, if there is a scroll I want it to be the first node (if enough scroll available) visible in the container.
Is there a JS I can call on the onOpen event to do that? Tried Clients.scrollIntoView but doesn't help.
Thanks
This might help others
String idContainer = controler.getCenter().getUuid() + "-cave";
String idTreeRow = item.getTreerow().getUuid();
item.setWidgetListener(Events.ON_OPEN, "var myContainer = jq('#" + idContainer + "'); var scrollTo = jq('#" + idTreeRow + "'); "
+ "myContainer.animate({scrollTop: scrollTo.offset().top - myContainer.offset().top + myContainer.scrollTop()});");
Asked: 2016-11-07 11:33:35 +0800
Seen: 25 times
Last updated: Nov 07 '16
How to capture onScroll Event of Combobox
Scroll a multiselect ListItem into view
scroll or pagination in charts
Scroll Listbox (or Grid) with MVVM model to bottom
Large Tree with dynamic columns
Tree width lost after changing col width on maximized panel
MVVM tree example to show add/insert/delete/move/drag?
Error writing 'checked' on type org.zkoss.zul.Checkbox [closed]