Dynamically loading tree nodes

Enterprise applications usually have data sets that prohibit the loading of the full tree in a single JSON request. Large trees can be configured to load children on a per node basis by expanding levels on demand. A few minor changes to our code can allow us to implement this dynamic loading of node children.

When a node is expanded, the tree store proxy submits a request that contains a node parameter with the ID of the node being expanded. The URL submitted is that which is configured in the proxy. We will change our tree store proxy as follows:

proxy: {
  type: 'ajax',
  url: 'company/treenode.json'
}

Note that the URL of the proxy has been changed to treenode. This mapping, when implemented in CompanyHandler, will load ...

Get Enterprise Application Development with Ext JS and Spring now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.