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

Loading a tree's nodes from the server

Creating a tree in your user interface is achieved using a Tree Panel. This recipe gives you the knowledge required to create and configure a Tree Panel and load JSON data asynchronously from your server to the tree. The final tree will look like the following screenshot:

Loading a tree's nodes from the server

Getting ready

Make sure you have a web server installed and running on your development computer. For the purposes of this demonstration, your web server will need to serve JSON files. If your server is not capable, add a MIME type for JSON (application/json).

How to do it...

  1. Start by defining an Ext.data.TreeStore to load our data into:
    var store ...

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