Results 1 to 4 of 4

Thread: Converting JSON String to object in Sencha Ext JS 6

  1. #1
    Sencha User
    Join Date
    Mar 2016
    Posts
    4

    Default Answered: Converting JSON String to object in Sencha Ext JS 6

    Hi,

    I am trying to decode a json string in Sencha Ext JS 6 so that I can get the values inside the json to add to a data store. Below is what I have tried from the API documentation;
    Code:
    Ext.application({
        name : 'Fiddle',
    
        launch : function() {
            var jsonString = "{\"Featured\": {\"Title\": \"Some title here.\"}";
            var jsonObject = Ext.JSON.decode(jsonString);
            Ext.Msg.alert(Ext.Object.getSize(jsonObject));        
        }
    });
    This however does not return any response. i.e. Nothing happens when I run it on fiddle.
    What might I be missing?

  2. You are missing one closing curly bracket.

  3. #2
    Sencha User
    Join Date
    Apr 2013
    Posts
    913
    Answers
    105

    Default

    You are missing one closing curly bracket.

  4. #3
    Sencha User
    Join Date
    Mar 2016
    Posts
    4

    Default Invalid JSON

    I checked my JSON string again and discovered that that was the problem.

  5. #4
    Sencha User
    Join Date
    Mar 2016
    Posts
    4

    Default Thanks

    I just noticed this, thank you.

Similar Threads

  1. Replies: 0
    Last Post: 26 Jan 2016, 2:08 PM
  2. Converting json to java object using struts json plugin
    By riya_phoenix in forum Ext 3.x: Help & Discussion
    Replies: 0
    Last Post: 16 Dec 2009, 5:08 PM
  3. converting json object to xml
    By bhanu prakash dasari in forum Ext 2.x: Help & Discussion
    Replies: 2
    Last Post: 18 Mar 2009, 11:39 PM
  4. [Solved]convert string to json object (c#)
    By ovan in forum Ext 2.x: Help & Discussion
    Replies: 3
    Last Post: 19 Jan 2009, 5:23 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •