I've a new problem today (first one : ExtJS 4.1 How to create a window with grid dynamically)
So, to resume my application is to display data about cars. I load all my cars (over 10k) like this :
Ext.create('Ext.data.Store', {
storeId: 'CarStore',
model: 'Car_Model',
proxy: {
type: 'ajax',
url: './cars.json',
reader: 'json'
},
autoLoad: {
callback: displayMenu
}
});
My displayMenu
function display a menu with buttons like this :
- Brand1
- Model1
- Model2
- Brand2
-Model1
- Etc
- All Cars
So when I create my buttons (depending of brand/model in my json store) I do this (exemple for a model button) :
var CarStore = Ext.data.StoreManager.lookup('CarStore');
var aCarButton= Ext.create('Ext.Button', {
text: myModelText,
handler: function(button, e) {
var grid = Ext.create("CarsGrid", { store: CarStore });
grid.filterByModel(myModelText);
var win = Ext.create("CarsWindow", { title: myModelText, items: [ grid ] });
win.show();
}
});
aMenuPanel.add(aAircraftButton);
Thus when I click on a button that display all cars for a brand/model in a grid that is in a window.
My problem is that the loading before display my data take about 5 second for a model, 10 for a brand and 2 min for all my cars.
PS : I use the same store for my button creation and all grids to display but with a filter (by brand, model, or none) like you see in grid.filterByModel(myModelText);
In my previous Answer VoidMain advised me to use buffered: true
but that produce an error when I click a button.