O'Reilly logo

Ext JS 4 Web Application Development Cookbook by Stuart Ashworth, Andrew Duncan

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Using a tree as a menu to load content into another panel

Having your application perform an action when the user clicks a node in a tree can be done by listening for the events raised by the Ext.tree.Panel class.

This recipe gives some insight on how to listen for these events, have them interact with a second panel, and have it create a new tab in it. For the purposes of this demonstration, the new tab we create will have its HTML property set to the text from the node's record. It would be straight-forward to extend this example for adding more complex components to your TabPanel.

Using a tree as a menu to load content into another panel

How to do it...

  1. Define a TreeStore with some example nodes for the ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required