1. #1
    Sencha User
    Join Date
    Feb 2012
    Posts
    16
    Vote Rating
    0
    Thomas The Fourth is on a distinguished road

      0  

    Default Answered: Modeling semi-complicated json structures

    Answered: Modeling semi-complicated json structures


    Hello,

    I'm trying to read a json feed from yahoo weather. Seems like a pretty simple response, but I can't figure out the approach I should use to bring the data into my model. I was thinking jsonReader might be key, but it doesn't seem to support the format. Any help would be appreciated. Thanks. Here the response:

    Code:
    {
        "units": {
            "temperature": "F",
            "speed": "mph",
            "distance": "mi",
            "pressure": "in"
        },
        "location": {
            "location_id": "USLA0338",
            "city": "New Orleans",
            "state_abbreviation": "LA",
            "country_abbreviation": "US",
            "elevation": 13,
            "latitude": 29.97000000000000,
            "longitude": -90.09000000000000
        },
        "wind": {
            "speed": 10.00000000000000,
            "direction": "WNW"
        },
        "atmosphere": {
            "humidity": "67",
            "visibility": "10",
            "pressure": "30.39",
            "rising": "rising"
        },
        "url": "http:\/\/weather.yahoo.com\/forecast\/USLA0338.html",
        "logo": "http:\/\/l.yimg.com\/a\/i\/us\/nt\/ma\/ma_nws-we_1.gif",
        "astronomy": {
            "sunrise": "06:21",
            "sunset": "18:03"
        },
        "condition": {
            "text": "Fair",
            "code": "34",
            "image": "http:\/\/l.yimg.com\/a\/i\/us\/we\/52\/34.gif",
            "temperature": 62.00000000000000
        },
        "forecast": [{
            "day": "Today",
            "condition": "Sunny",
            "high_temperature": "72",
            "low_temperature": "52"
        }, {
            "day": "Tomorrow",
            "condition": "Mostly Sunny",
            "high_temperature": "70",
            "low_temperature": "62"
        }]
    }

  2. A Store needs an array so this response wouldn't work. You could use a store and get the forecasts but the other info wouldn't be part of any record.

  3. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    35,704
    Answers
    3356
    Vote Rating
    750
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    A Store needs an array so this response wouldn't work. You could use a store and get the forecasts but the other info wouldn't be part of any record.
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

  4. #3
    Sencha User
    Join Date
    Feb 2012
    Posts
    16
    Vote Rating
    0
    Thomas The Fourth is on a distinguished road

      0  

    Default


    Thanks for the reply. Is there no way to massage the data prior to ingest? It seems like this would be something that would commonly need to be done.

Thread Participants: 1

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar