The check tree

The tree panel also has the ability to add checkboxes to its nodes. To do this, we need to add one more property to each node in the data source that we are applying to the tree panel.

Let's use the first example of this chapter, and we will change the root property (data) as follows:

root: {
  text: 'My Application',
  expanded: true, 
  checked:false,
  children: [{
    text: 'app',
    checked:false,
    children:[
    { leaf:true, text: 'Application.js', checked:false }
    ]
    },{
      text: 'controller', expanded: true, children: [],
      checked:false
    },{
      text: 'model', expanded:true, checked:false,
      children: [
        {leaf:true, text: 'clients.js', checked:false},
        {leaf:true, text: 'providers.js', checked:false},
        {leaf:true, text: 'users.js', checked:false} ] },{ text: ...

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.