PDA

View Full Version : Ext JS 4 Tree Store not loading using Ajax



praveenbkec
2 Nov 2013, 11:55 PM
I am not new to Ext JS and am working on Ext JS 4. I was implementing a tree, where the data should be loaded dynamically. For that I was using Ajax returns JSON response.

Model : Ext.define('sgd.monitoring.model.MonitoringModel', { extend : 'Ext.data.Model', xtype : 'basic-trees', fields : [ { name : 'Name', type : 'string' } ] }); Ajax response : {success: true,children:[{'Name':'Praveen'}]} Store : Ext.define('sgd.monitoring.store.MonitoringStore', { extend : 'Ext.data.TreeStore', model : 'sgd.monitoring.model.MonitoringModel', autoLoad:true, pageSize : 1000, proxy : { type : 'rest', url : '/api/tree', reader : { type : 'json' //root : 'data' } } }); Error in Firebug console:

"NetworkError: 404 Not Found - http://x.x.x.:8080/api/tree/root?_dc=1383458930310&node=root"Please Help.............

scottmartin
4 Nov 2013, 12:51 PM
Sounds like your URL is not valid: 404 Not Found

What do you get when you enter the URL manually in a browser?

Also, please format your code .. so we can understand what we are looking at.

You can look at the Tree examples (tree.TwoTrees) :: Multiple Trees example