-
8 Nov 2012 4:08 PM #1
Unanswered: Basic Tree example using url for json data
Unanswered: Basic Tree example using url for json data
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
-
8 Nov 2012 4:13 PM #2Sencha - Ext JS Dev Team
- Join Date
- Apr 2007
- Location
- Sydney, Australia
- Posts
- 15,103
- Vote Rating
- 97
- Answers
- 170
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:
There's heaps of json libraries for .NET out there. I like http://james.newtonking.com/pages/json-net.aspxCode:Response.Write("{\"success\": true}");Evan Trimboli
Sencha Developer
Twitter - @evantrimboli
Don't be afraid of the source code!
-
8 Nov 2012 4:17 PM #3
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.
-
8 Nov 2012 4:28 PM #4Sencha - Ext JS Dev Team
- Join Date
- Apr 2007
- Location
- Sydney, Australia
- Posts
- 15,103
- Vote Rating
- 97
- Answers
- 170
There's a whole bunch of tree examples in the SDK download under /examples/tree
Evan Trimboli
Sencha Developer
Twitter - @evantrimboli
Don't be afraid of the source code!


Reply With Quote