PDA

View Full Version : Jump to anchor in panel with html [SOLVED]



FoxMulder900
29 Sep 2009, 7:16 AM
I set up a tree panel as a table of contents for quite a bit of html data that I have. I also have a panel filled with the html data and inside the html I have an anchor for each node in the tree. I want to be able to click a node in the tree and have the html panel jump to the appropriate anchor. Any ideas on how to do something like this? Alternatively if I could figure out how to set the y scroll position of the panel I could get the position of the anchor and scroll to it manually.

Any input would be much appreciated!

Animal
29 Sep 2009, 7:33 AM
Use Element.scrollIntoView?

FoxMulder900
29 Sep 2009, 9:22 AM
Great! Thanks a lot! all I had to do was:

Ext.get('anchor_id').scrollIntoView(TextPanel.body);