Note that there are some explanatory texts on larger screens.

plurals
  1. POCan't show the json Data in Treepanel in extjs 4
    primarykey
    data
    text
    <p>I am working on showing JSON data in EXTJS 4 TreePanel. But my tree is not showing any data . Please let me know where I am wrong. Let me post my codes below:</p> <p>View Part: it has got the treepanel</p> <pre><code>xtype: 'treepanel', title: 'Standard Geographies', height: 250, width: 310, store: 'Data', border: 1, displayField: 'name', useArrows: true, rootVisible: true, multiSelect: true, preventHeader: true, renderTo: Ext.getBody(), columns: [{ xtype: 'treecolumn', text: 'Standard Geographies', flex: 1, sortable: false, //renderer : change, dataIndex: 'name' }], </code></pre> <p>Model Part: Using json data</p> <pre><code>Ext.define('TA.model.TAModel', { extend: 'Ext.data.Model', fields: ['name','typeId'], //fields: ['abbr','type'],['name','typeId'] proxy: { type: 'ajax', url : 'data/StandardGeoTree.json', actionMethods: { read: 'POST' }, reader: { type: 'json', root: 'geographyOptions' }, } }); </code></pre> <p>Store Part: I hope all is ok in the store part</p> <pre><code>Ext.define('TA.store.Data', { //extend: 'Ext.data.Store', //model: 'TA.model.TAModel', extend: 'Ext.data.TreeStore', model: 'TA.model.TAModel', autoSync: true, autoLoad: true, listeners: { load:function(){ console.log('Schemes Data store loaded'); } }, proxy: { type: 'ajax', //url : 'data/StandardGeoTree.json', api: { //read: 'data/StandardGeo.json', read: 'data/StandardGeoTree.json', //update: 'data/updateTradeArea.json' }, reader: { type: 'json', root: 'root', successProperty: 'success', idProperty : 'typeId' } }, root : { text: 'Root', id: 'typeId', expanded : true, loaded : true, children: [] } }); </code></pre> <p>JSON</p> <pre><code>{ "success": true, "root" : [ { "name": "001-USA", "typeId" : "1", "children":[ {"name": "USA", "typeId" : "1", "leaf":"true"}, {"name": "State", "typeId" : "2", "leaf":"true"}, {"name": "DMA", "typeId" : "3", "leaf":"true"}, {"name": "CSA", "typeId" : "4", "leaf":"true"}, ] } ] } </code></pre>
    singulars
    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.
 

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