Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Here is an example of a tree panel i was able to get functional in MVC structure using 'data' as children:</p> <p><strong>JSON:</strong></p> <pre><code>Ext.data.JsonP.callback4({ "message": "", "data": [ { "descr": "TEST REASON", "leaf": false, "data": [ { "descr": "TEST REASON", "leaf": true, "data": null } ] }, { "descr": "Another Type Code", "leaf": false, "data": [] }, { "descr": "Quite A Different One I Think", "leaf": false, "data": [ { "descr": "A Child Of That", "leaf": true, "data": null } ] } ] }) </code></pre> <p><strong>MODEL:</strong></p> <pre><code>Ext.define('App.model.treePanel', { extend: 'Ext.data.Model', fields: [ { name: 'descr', type: 'auto' }, { name: 'leaf', type: 'auto' } ], proxy: { type: 'jsonp', url: 'yourURL', //extraParams: { //}, headers: { 'Content-type': 'text/json; charset=utf-8', 'Accepts': 'text/json' }, reader: { type: 'json', root: 'data', successProperty: 'success' } } }); </code></pre> <p><strong>STORE:</strong></p> <pre><code>Ext.define('App.store.treePanels', { extend: 'Ext.data.TreeStore', model: 'App.model.treePanel' }); </code></pre> <p><strong>VIEW:</strong></p> <pre><code>Ext.define('App.view.treePanel', { extend: 'Ext.tree.Panel', xtype:'treePanel', title: 'My Items', store: 'treePanels', rootVisible: false, //hideHeaders:true, columns: [ { xtype: 'treecolumn', dataIndex: 'descr', text: 'Current Types and Reasons', flex: .5 } ], tbar:{ items: [ { xtype: 'button', text: 'Remove Item' }, { xtype: 'button', text:'Edit Item' } ] } }); </code></pre> <p><strong>Please note: <code>rootVisible:false</code> was required.</strong></p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload