[revised] I'm creating a TreePanel in ExtJs that is loading its children from a JSON file. I'm having trouble adding a click action to the nodes. I'm not sure whether it's added in the script creating the tree, or if its added as a property in the JSON, and if so, what the syntax would be. Any help would be appreciated! Please provide an example if possible.
相关问题
- How can I set the row height in Tkinter TreeView?
- Sencha Touch Uncaught typeError: undefined is not
- Treeview validation
- How I'll create a model from json file? (ExtJS
- Decimal precision in an EXTJS grid
相关文章
- C# WinForm TreeView 怎么做半透明或者透明背景?
- Sort TreeView Automatically Upon Adding Nodes
- Sencha Ext.define Uses vs Requires
- Scrolling issues with ExtJS 5 app inside IFrame
- Sencha Touch in WebView
- load different views into viewport
- Abort an ext js grid store ajax call
- Disabling the timezone conversion in ExtJS
This is a very commonly talked about question(events in general), so I would suggest searching the extjs forums and reading what they have in their learning center.
Event listeners can be assigned on creation of the TreePanel or attached to an existing TreePanel.
I have a similar (and common) setup where I have a tree that I use as a navigation menu and each leaf node acts as a link that should be opened in a TabPanel.
To handle the node clicks, you could do something like:
Jozef Sakalos(aka Saki) has allot of great information on his site extjs.eu. I think you would be most interested in the component communication example.
Gerry is putting you on the right track, and you can never go wrong with Saki's examples. I just answered a very similar question. That answer may give you more information as well:
How do I find the selected node in an ExtJS TreePanel?
Add a listener to the TreePanel:
and use the data in the node.