I am creating sencha web app using sencha touch 2.2.1. In my application I have screen which consists of a container where I added multiple panels. A single panel consists of two panels, a top panel and the inner panel.
On initialization of page, I am calling ajax api to fetch list of data for top panel of each item in container. and on top panel clicked, I am calling api for that item to fetch data for inner panel. On api call finished, I am rendering data to inner panel and making that panel visible. This code is same for all items in a container on top panel clicked.
There is also a button at top to 'expandAll' which will call api's for all items in a for loop one after one and rendering data for each inner panel. First I am calling one api and then on getting response of that I am storing in store and rendering on screen then calling next api, like this for all items.
getDetailData:function(params){
var detailStore=Ext.getStore('DetailData');
detailStore.load({
callback:function(data,opt,success) {
detailStore.storeDetailData(data);
_this.onShowDetailData(data);
// now call next api from here until all items data fetched and displayed
}
});
}
In this case, fetching all items data and rendering on ui thread is taking more time and app slows down.
Also while rendering data, I have to apply filters on store to filter data before rendering data for each time.
I wanted to know how should I do this processing and rendering work. As ajax api call and fetching data from server is not taking more time but processing and rendering is taking more time.
Any suggessions on this,
thanks