PDA

View Full Version : TreePanel with 'anchors' as nodes



psypaul
14 Dec 2010, 4:53 AM
Hi,

I have a treepanel with nodes.
When nodes are clicked I want to display the corresponding part of a html document in another panel. (next to the treepanel)
I've been thinking that it might be possible by using anchors as the nodes of the tree, but I haven't been able to figure out how to implement this.

Can you guys please help me out?
Maybe there's another easier way to do this?

Thanks

sven
14 Dec 2010, 4:55 AM
When nodes are clicked I want to display the corresponding part of a html document in another panel. (next to the treepanel)
I dont understand why you want to use anchors for this.

Cannot you add an Events.SelectionChange listener to the selectionmodel of the TreePanel? Also change the selectionmode to single. You can do whatever needed inside this event listener.

psypaul
14 Dec 2010, 5:00 AM
Thanks for the quick reply.

There's no specific reason for the anchors but I don't know of another way to scroll/link to the specific part of the html document.
I currently have a single selection model and have added a listener to it, but how do I link to the specific part of the html document?

sven
14 Dec 2010, 5:04 AM
but how do I link to the specific part of the html document?
You can use DomQuery to query for any specifc element and than call
element.scrollIntoView();

psypaul
14 Dec 2010, 5:06 AM
Ok, I'll try that.
Thank you.