PDA

View Full Version : Basic Tree example using url for json data



deving
8 Nov 2012, 4:08 PM
I'm just starting to use Extjs. I'm using ASP.NET MVC and I have a page that returns Json data. I now need a tree that can consume and display that data. I have tried many, many samples and continue to get random errors. It seems like everyone does it in a slightly different way. Some use a TreeStore, some don't, some put the proxy data in the treestore, some in the model...I just don't understand.

Can anyone provide a very basic tree example that gets its data from a url instead of static data? Thank you in advance

evant
8 Nov 2012, 4:13 PM
Whether it's static or not doesn't matter. Your server side code needs to produce the same JSON.

For example, you could (but don't) do:



Response.Write("{\"success\": true}");


There's heaps of json libraries for .NET out there. I like http://james.newtonking.com/pages/json-net.aspx

deving
8 Nov 2012, 4:17 PM
The issue is that when I'm debugging, the url is never even called. I'm always getting javascript errors before the data is even asked for. So I just need a very very simple example that I can start with.

evant
8 Nov 2012, 4:28 PM
There's a whole bunch of tree examples in the SDK download under /examples/tree