1. #1
    Sencha User
    Join Date
    Jan 2012
    Posts
    21
    Answers
    1
    Vote Rating
    1
    Souri is on a distinguished road

      0  

    Default Answered: Ext.data.Model mapping unkown fields

    Answered: Ext.data.Model mapping unkown fields


    Hi, I'm trying to figure out how to map JSON data from my mediawiki site... an example of the json structure is:

    Code:
    {
      "query": {
        "normalized": [
          {
            "from": "From",
            "to": "To"
          }
        ],
        "pages": {
          "566": {
            "pageid": 566,
            "ns": 0,
            "title": "title here",
            "revisions": [
              {
                "booyah"
              }
            ]
          }
        }
      }
    }
    I want to get the details in "revisions" but the problem is that it's parent field ('566' in this case) is different for every page. How do I correctly map to get the revisions data if that field is always different?

  2. Once you have a valid JSON-format (always "key": "value", so "booyah" over there is invalid),
    you can decode the JSON-string with Ext.JSON.decode(string).
    Then i think you can get your wanted values with the array-notation.
    Something like decodedJson.pages[0].revisions

  3. #2
    Sencha User
    Join Date
    Aug 2011
    Location
    Belgium
    Posts
    29
    Answers
    4
    Vote Rating
    4
    gamevampy is on a distinguished road

      0  

    Default


    Once you have a valid JSON-format (always "key": "value", so "booyah" over there is invalid),
    you can decode the JSON-string with Ext.JSON.decode(string).
    Then i think you can get your wanted values with the array-notation.
    Something like decodedJson.pages[0].revisions

  4. #3
    Sencha User
    Join Date
    Jan 2012
    Posts
    21
    Answers
    1
    Vote Rating
    1
    Souri is on a distinguished road

      0  

    Default


    Thanks for your reply. I got my json in the reader where it's an object and converted to a string with Ext.JSON.encode(object).

    Anyway, with a bunch of string manipulations on that, I finally got the data I was after!

Thread Participants: 1

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..." hd porno faketaxi