1. #1
    Sencha User StevenInc's Avatar
    Join Date
    Jul 2009
    Location
    NYC
    Posts
    72
    Vote Rating
    0
    StevenInc is on a distinguished road

      0  

    Default Ext.util.JSON.decode(resp.responseText).x Syntax Question

    Ext.util.JSON.decode(resp.responseText).x Syntax Question


    I have a json response like the following:
    HTML Code:
    {"DATASET":1,"ROWS":[{"INSERT_ID":22}],"STARTROW":1.0,"ENDROW":50.0}
    And I am trying to access the INSERT_ID value.

    This does not work:
    HTML Code:
    var insert_id = Ext.util.JSON.decode(resp.responseText).INSERT_ID;
    Any advice would be greatly appreciated.

    Thank you.

  2. #2
    Sencha User
    Join Date
    Jan 2008
    Location
    Toronto, Canada
    Posts
    480
    Vote Rating
    4
    elishnevsky is on a distinguished road

      0  

    Default


    Do you not see the structure of your own JSON data?

    This should work:
    Ext.util.JSON.decode(resp.responseText).ROWS[0].INSERT_ID

  3. #3
    Sencha User StevenInc's Avatar
    Join Date
    Jul 2009
    Location
    NYC
    Posts
    72
    Vote Rating
    0
    StevenInc is on a distinguished road

      0  

    Default Solved

    Solved


    Thank you,
    That makes sense and it works.

Thread Participants: 1