I'm having an odd issue. I am setting up a store and calling the load function. When the store loads I create a column model based on the results and then pass that store into a grid and call reconfigure(). The grid looks to have the right number of rows displayed and the column headers are correct but the actual data in the cells is blank. If I, however, call grid.getStore().load() after the reconfigure (which sucks because I've already loaded the store), the data shows up correctly. Does anybody have any idea why this is happening? A snippet of the relevant code is below.
dynStore.load({
callback: function(records, operation, success) {
if (records && records.length) {
var dynStore = Ext.getStore('DynamicReportGeneratorResults');
var modelFields = [];
var dynamicColumns = [];
var sampleRow = records[0].raw;
Ext.Object.each(sampleRow, function (key, value) {
modelFields.push(key);
var dynColObj = {text: key, dataIndex: key};
if (key == "id") {
dynColObj.hidden = true;
}
dynamicColumns.push(dynColObj);
});
dynStore.model.setFields(modelFields);
var config = {'reportName': this['currentReportName']};
var reportResultWindow = Ext.create('Rms.view.DynamicReportGeneratorReportResultsWindow', config);
reportResultWindow.show();
this.getDynamicReportResultsGrid().reconfigure(dynStore, dynamicColumns);
/////*******
//this next line is stupid since the store is already loaded with data
/////*******
this.getDynamicReportResultsGrid().getStore().load();
}
else {
Ext.Msg.alert("Report Resuts", "No results from this report");
}
},