0

Not sure what I am doing wrong here, but let me setup the scenario.

In the beginning, a store(resultsStore) is being populated with data and being displayed via a function call.

Now, an intermediate step of obtaining more data by way of another store is needed and passing both sets to the original function.

I have tried many variations of the below, but the two datasets do not seem to be passed to the updateLeftPanel function, the first one is there fine, the second says "undefined". Anything obvious I am missing?

resultsStore.load({
    params: {
        'certid' : certId
    },
    callback: function(record,operation,success){
        updateRightPanel(record[0].data);  // code not shown,works fine
        //updateLeftPanel(record[0].data);   // original call

        loadCriteriaStore(record[0].data);  // new call


    }
});

function loadCriteriaStore(data)
{
    criteriaStore.load({
        params: {
            'edition' : data['Edition']
        },
        callback: function(record,operation,success,data){
            updateLeftPanel(data,record[0].data);  
            // orig data first, new dataset second
        }


    });

}

 function updateLeftPanel(data, dataa){ 
 // code here
          dataa object still unpopulated
 }
4

1 に答える 1

1

関数のコールバックでは、loadCriteriaStore4 つのパラメーターを割り当てています。私はそれが3だけを通過すると仮定しています。

そのため、そのコールバックでdataは、データを含む が新しい「ローカル」によって上書きされていdataますundefined

function loadCriteriaStore(data)
{
    criteriaStore.load({
        params: {
            'edition' : data['Edition']
        },
        // Get rid of the ",data" here
        callback: function(record,operation,success){
            // the `data` param will be the value passed to `loadCriteriaStore`
            updateLeftPanel(data,record[0].data);
            // orig data first, new dataset second
        }


    });

}
于 2013-02-05T16:06:52.257 に答える