1. #1
    Sencha User
    Join Date
    Nov 2012
    Posts
    22
    Vote Rating
    0
    deving is on a distinguished road

      0  

    Default 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

  2. #2
    Sencha - Ext JS Dev Team evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    16,987
    Answers
    464
    Vote Rating
    649
    evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute

      0  

    Default


    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:

    Code:
    Response.Write("{\"success\": true}");
    There's heaps of json libraries for .NET out there. I like http://james.newtonking.com/pages/json-net.aspx
    Evan Trimboli
    Sencha Developer
    Twitter - @evantrimboli
    Don't be afraid of the source code!

  3. #3
    Sencha User
    Join Date
    Nov 2012
    Posts
    22
    Vote Rating
    0
    deving is on a distinguished road

      0  

    Default


    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.

  4. #4
    Sencha - Ext JS Dev Team evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    16,987
    Answers
    464
    Vote Rating
    649
    evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute

      0  

    Default


    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!

Thread Participants: 1