1. #1
    Sencha User
    Join Date
    Oct 2012
    Posts
    53
    Vote Rating
    0
    sandeepmnit35 is on a distinguished road

      0  

    Default Unexpected number error

    Unexpected number error


    I am using below code and it is giving me "unexpected expection" error:
    HTML Code:
    DailyStoreFunction: function(instancestore,i,endValue) {
            currentdate = dateFormat(RA.app.currentDate[RA.app.currentActivePanelIndex],"yyyy-mm-dd");
            var url = 'getChartData.do?date='+currentdate+'&granularity='+RA.app.granularities[RA.app.currentActivePanelIndex]+'&chartSelection='+RA.app.chartTypes[RA.app.currentActivePanelIndex]+'&chartType='+RA.app.chartTypes[RA.app.currentActivePanelIndex]+'&x_axis='+RA.app.xs[RA.app.currentActivePanelIndex]+'&y_axis='+RA.app.ys[RA.app.currentActivePanelIndex]+'&groupBy='+RA.app.groupBys[RA.app.currentActivePanelIndex]+'&fixOrderString='+RA.app.fixOrder+'&groupByBar1='+RA.app.groupByValueBar[0]+'&groupByBar2='+RA.app.groupByValueBar[1]+'&groupByBar3='+RA.app.groupByValueBar[2]+'&groupByBar4='+RA.app.groupByValueBar[3]+'&absStartDate='+dateFormat(RA.app.startDate[RA.app.currentActivePanelIndex],"yyyy-mm-dd")+'&absEndDate='+dateFormat(RA.app.currentEndDate[RA.app.currentActivePanelIndex],"yyyy-mm-dd");
            //debugger;
            instancestore[i] = Ext.create('Ext.data.Store', {
                autoLoad: true,
                model: 'RA.model.DataModel',
                proxy: {
                    type: 'ajax',
                    timeout: 240000,
                    noCache: false,
                    url : url,
                    success: function(response) {
                        //debugger;
                        console.info('Response from the store= '+response.responseText);
                    },
                    reader: {
                        type: 'json'
                    }
                }
            });
            /*}
            else{
                instancestore[i] = Ext.create('Ext.data.Store', {
                    autoLoad: true,
                    model: 'RA.model.DataModel',
                    proxy: {
                        type: 'memory',
                        data: data,
                        reader: {
                            type: 'json'
                        }
                    }
                });
            }*/        
            return instancestore;
        },
    
    
    
    
    Here is the output of the json:

    HTML Code:
    [{
        "Month": "January",
        "length": 0,
        "Qualification": 0,
        "1.75 L Authentics (PET)": 0,
        "200ml Universal": 0,
        "630235 Smrnf Ice 2x12 4.5": 0,
        "others": 0
    },
    {
        "Month": "February",
        "length": 0,
        "Qualification": 0,
        "1.75 L Authentics (PET)": 0,
        "200ml Universal": 0,
        "630235 Smrnf Ice 2x12 4.5": 0,
        "others": 0
    },
    {
        "Month": "March",
        "length": 0,
        "Qualification": 0,
        "1.75 L Authentics (PET)": 0,
        "200ml Universal": 0,
        "630235 Smrnf Ice 2x12 4.5": 0,
        "others": 0
    },
    {
        "Month": "April",
        "length": 0,
        "Qualification": 0,
        "1.75 L Authentics (PET)": 0,
        "200ml Universal": 0,
        "630235 Smrnf Ice 2x12 4.5": 0,
        "others": 0
    },
    {
        "Month": "May",
        "length": 0,
        "Qualification": 0,
        "1.75 L Authentics (PET)": 0,
        "200ml Universal": 0,
        "630235 Smrnf Ice 2x12 4.5": 0,
        "others": 0
    },
    {
        "Month": "June",
        "length": 0,
        "Qualification": 0,
        "1.75 L Authentics (PET)": 0,
        "200ml Universal": 0,
        "630235 Smrnf Ice 2x12 4.5": 0,
        "others": 0
    },
    {
        "Month": "July",
        "length": 0,
        "Qualification": 0,
        "1.75 L Authentics (PET)": 0,
        "200ml Universal": 0,
        "630235 Smrnf Ice 2x12 4.5": 0,
        "others": 0
    },
    {
        "Month": "August",
        "length": 0,
        "Qualification": 0,
        "1.75 L Authentics (PET)": 0,
        "200ml Universal": 0,
        "630235 Smrnf Ice 2x12 4.5": 0,
        "others": 0
    },
    {
        "Month": "September",
        "length": 0,
        "Qualification": 0,
        "1.75 L Authentics (PET)": 0,
        "200ml Universal": 0,
        "630235 Smrnf Ice 2x12 4.5": 0,
        "others": 0
    },
    {
        "Month": "October",
        "length": 0,
        "Qualification": 0,
        "1.75 L Authentics (PET)": 0,
        "200ml Universal": 0,
        "630235 Smrnf Ice 2x12 4.5": 0,
        "others": 0
    },
    {
        "Month": "November",
        "length": 90,
        "Qualification": 71,
        "1.75 L Authentics (PET)": 19,
        "200ml Universal": 0,
        "630235 Smrnf Ice 2x12 4.5": 0,
        "others": 0
    },
    {
        "Month": "December",
        "length": 0,
        "Qualification": 0,
        "1.75 L Authentics (PET)": 0,
        "200ml Universal": 0,
        "630235 Smrnf Ice 2x12 4.5": 0,
        "others": 0
    }]

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    St. Louis, MO
    Posts
    34,107
    Vote Rating
    453
    mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of

      0  

    Default


    I cannot read your code. Can you format it?
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    http://www.JSONPLint.com - Source to lint your JSONP!

    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 almost in print!

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

  3. #3
    Sencha User
    Join Date
    Oct 2012
    Posts
    53
    Vote Rating
    0
    sandeepmnit35 is on a distinguished road

      0  

    Default


    I have formatted the code so now you can read it easily.
    Thanks

Tags for this Thread