Why would records.length be set to a number greater than 0, but the store.data.length is equal to 0? I'm basically trying to reference my store inside of the callback, so that my grid has data before I add it to my form. But the store data doesn't exist for some reason. If you have a better way of achieving the same end result, I'm willing to change it to your suggestion. Essentially, each grid is dynamically built based on different filters from the wrapping loop of this code.
var p = item.get('p');
var store = Ext.create('App.store.example.MyStore');
store.clearFilter(true);
store.filter('s', s);
store.filter('p', p);
store.load({
callback: function(records, operation, success) {
alert(store.data.length);
alert(records.length);
var grid = Ext.create('App.view.example.MyGrid', {
store: store
});
formPanel.add(
Ext.create('Ext.form.FieldSet', {
id: p + '_TOP',
title: p,
width: '100%',
anchor: '100%',
layout: {
type: 'vbox',
align: 'stretch'
},
items: [myGrid]
})
);
formPanel.doLayout();
}
});
formPanel.doLayout();
});