PDA

View Full Version : Unexpected number error



sandeepmnit35
22 Nov 2012, 1:51 AM
I am using below code and it is giving me "unexpected expection" error:


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:



[{
"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
}]

mitchellsimoens
23 Nov 2012, 1:04 PM
I cannot read your code. Can you format it?

sandeepmnit35
25 Nov 2012, 9:19 PM
I have formatted the code so now you can read it easily.
Thanks