The TreeStore

The TreeStore (Ext.data.TreeStore) is a special store in the Ext JS library. It is designed especially for working with the tree structure, which is Ext.tree.Panel in this case. As this class extends Ext.data.Store which in turn sequentially extends Ext.data.AbstractStore, you will notice that the behavior is similar to Ext.data.Store.

When we define our stores, we need to specify a data model. In this case (TreeStore), if we don't specify a model, then Ext JS will create an implicit data model using the Ext.data.NodeInterface class, which will lead to creating a model for our store.

Let's see an example of loading data from the server into our Ext.data.TreeStore class:

Ext.onReady(function(){ Ext.tip.QuickTipManager.init(); //Store ...

Get Learning Ext JS - Fourth Edition 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.