PDA

View Full Version : [CLOSED] ensureVisible in TreePanel



EddieJensen
Oct 29, 2014, 7:41 PM
Hi Everyone,
I'm using Razor and MVC3, Ihave a couple of tree panels and I want to be able to highlight a node in the tree and have the panel scroll to that node and display it automatically.

In the thread:
http://forums.ext.net/showthread.php?17263-CLOSED-TreePanel-scrollbar-does-not-scroll-to-selected-node

there is a code snippet:


var node = this.getNodeById('5.3.2');
node.ensureVisible(function () {
this.select();
});

called in the AfterRender event of a tree panel.
When I try to implement this, the call to getNodeById fails because it is undefined.

When I look in the docs, I can only see getNodeById as a member of TreeStore not the TreePanel itself.
I can get the store then call getNodeById to get a node from the store, but then the ensureVisible function is undefined on that node.

Does anyone know how to call ensureVisible on a tree panel node?

Thanks!
Cheers,
Eddie

Daniil
Oct 29, 2014, 8:34 PM
Hi @EddieJensen,

Please search for "ensureVisible" in this document. There is the note about the ensureVisible method.
http://examples2.ext.net/#/Getting_Started/Release_Documents/BREAKING_CHANGES/

EddieJensen
Oct 29, 2014, 8:50 PM
replaced code with:


tree.getView().focusRow(node);

works perfectly! Thank you very much :)