Hi all,

I m trying to load the jsonstore from a json object using asynchronous callback function.I am not able to loading it in the store, it is showing the following error.

Uncaught TypeError: Cannot call method 'loadData' of undefined


My code is as follows

Code:
window.generateData = function(year,quarter) {
    var data;
    var linePlot;
    var lplot;
    var month1Label;
    var month1Value;
    var month2Label;
    var month2Value;
    var month3Label;
    var month3Value;
    var jsonReq={"rootCauseInput":{"year":year,"quarter":quarter}};
    var jsonReqObj = Ext.util.JSON.encode(jsonReq);
    Ext.Ajax.request({
        url: "http://localhost:8080/cits/services/CitsService/getUnknownRootCauseByMonth",
        method: 'POST',
        headers: {'Content-Type': 'application/json'},
        jsonData: jsonReqObj,
      success: function(responseObject){
        var dataObj = Ext.decode(responseObject.responseText);
        alert(responseObject.responseText);
        console.info(responseObject.responseText);
        var xaxis=dataObj.xaxis;
        alert(xaxis);
        var yaxis=dataObj.yaxis;
        alert(yaxis);
         linePlot=dataObj.lineGraphPlotsList;
         lplot=linePlot.lineGraphPlots;
         month1Label=lplot[0].label;
         month1Value=parseInt(lplot[0].value);
         month2Label=lplot[1].label;
         month2Value=parseInt(lplot[1].value);
         month3Label=lplot[2].label;
         month3Value=parseInt(lplot[2].value);
        alert(month1Label);    
        alert(month1Value);    
        alert(month2Label);    
        alert(month2Value);    
        alert(month3Label);    
        alert(month3Value);        
        var store = Ext.getCmp('store1');
        if (dataObj.lineGraphPlotsList.lineGraphPlots) {
            if (dataObj.lineGraphPlotsList.lineGraphPlots.length > 0) {
                store.loadData(dataObj.lineGraphPlotsList.lineGraphPlots, false);
            }}         
      },  
         failure: function(responseObject){
                 alert("error");                 
            }
        
        });


};

var storepie10 = new Ext.data.JsonStore({
   fields: ['label','value'],
    data: generateData(11,"Q4")
});

I am getting the following "responseObject.responseText"

{"xaxis":null,"yaxis":null,"lineGraphPlotsList":{"lineGraphPlots":[{"label":"JUN","value":"0"},{"label":"MAY","value":"0"},{"label":"JUL","value":"1"}]}}

I can also get the values in alert inside the success function.

please help me
thanks in advance