1. #1
    Sencha User
    Join Date
    Mar 2011
    Location
    Leicester
    Posts
    68
    Answers
    2
    Vote Rating
    0
    sadagopan is on a distinguished road

      0  

    Default Unanswered: Sencha touch Charts data from JSON service

    Unanswered: Sencha touch Charts data from JSON service


    Hi ,
    I designed the charts with the local data in the store which is working fine , but if i load the json from the server im not getting the chart and throws the following error " Cannot call method 'each' of null". it cannot find my store, but the store is defined.

    code for verification
    Store
    Code:
    Ext.define("Mp.store.SampleStore", {
        extend: "Ext.data.JsonStore",
        requires:['Mp.model.Monitor'],
        config: {
            autoLoad:true,
            storeId :'SampleDataStore',
            model : "Mp.model.Monitor",
            proxy: {
            type: 'ajax',
            url:'http://xxx.com/JAXBRest/Rest/restjaxb/json',
              reader: {
                type: 'json',
                rootProperty:'monitor'
    
    
            }
        
        }
        }
    });
    Model code
    Code:
    Ext.define("Mp.model.Monitor", {extend : 'Ext.data.Model',
    config:{
    
    
                 fields: [
            {name: 'fans', type: 'int'},
            {name: 'name', type: 'string'}
        ]
                }
            });
    JSON the URL returns the following
    Code:
    {
        "monitor": [
            {
                "fans": "9500",
                "name": "SAML"
            },
            {
                "fans": "2050",
                "name": "Oauth"
            },
            {
                "fans": "6006",
                "name": "OpenID"
            },
            {
                "fans": "7000",
                "name": "WSFED"
            }
        ]
    }

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,330
    Answers
    3541
    Vote Rating
    847
    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


    Is your store loading data? Check to see if the store has data.
    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.

  3. #3
    Sencha User
    Join Date
    Mar 2011
    Location
    Leicester
    Posts
    68
    Answers
    2
    Vote Rating
    0
    sadagopan is on a distinguished road

      0  

    Default


    Hi ,
    Thanks for the reply. The store is getting loaded , i could see that in chrome.but still the chart is not getting loaded and throws the same error ": Cannot call method 'each' of null".

  4. #4
    Sencha User
    Join Date
    Mar 2011
    Location
    Leicester
    Posts
    68
    Answers
    2
    Vote Rating
    0
    sadagopan is on a distinguished road

      0  

    Default


    Any ideas ?

Thread Participants: 1

Tags for this Thread