-
17 Oct 2012 7:04 AM #1
Unanswered: Tree View - referring to Nodes programatically
Unanswered: Tree View - referring to Nodes programatically
I have defined a TreeView, and when it gets rendered to the HTML page, the first element is a DIV with the id of my TreeView:
There are some nested DIVs under that, with Id's like 'treeview-xxxx' and 'ext-genxxxx'Code:<div id="levelTreePanel" class="x-panel x-tree-panel x-tree-lines x-grid x-grid-header-hidden x-panel-default" style="height: 120px; width: 320px; " role="presentation"> ... </div>
Then there's a TABLE
In cells of the table are Divs that render each of the Nodes in my Tree data.
I would like to be able to reference these Divs that represent my Nodes from Javascript, but the generated Node-Divs don't have Ids at all. I've tried assigning 'id' attributes to the nodes of the Tree data, but these don't get rendered anywhere on the resulting HTML.
Is there a way to get the framework to assign Id values to the Nodes of the tree?
-
22 Oct 2012 9:09 AM #2Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,684
- Vote Rating
- 435
- Answers
- 3111
What are you actually trying to accomplish?
Mitchell Simoens @SenchaMitch
Sencha Inc, Senior Forum Manager
________________
http://www.JSONPLint.com - Source to lint your JSONP!
Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
https://github.com/mitchellsimoens
Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/
Need more help with your app? Hire Sencha Services services@sencha.com
Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is almost in print!
When posting code, please use BBCode's CODE tags.
-
22 Oct 2012 5:44 PM #3
Try this:
Code:function getDivRef (nodeId){ // nodeId is record Id var divRef = null; var node = treeStore.getNodeById(nodeId); node = treePanel.getView().getNode(node); if(node){ divRef = Ext.fly(node).down('div'); } return divRef; }


Reply With Quote