PDA

View Full Version : showing loader while loading store



babar.sajjad
22 Jan 2011, 7:14 AM
i am unable to show loader when store is loaded i do not want to auto load the store, is there any way that i can show loader image.

AndreaCammarata
22 Jan 2011, 7:53 AM
Hi babar.
A way to do this is this:
First of all you have to declare your mask object in the scope of your application



var loadMask = new Ext.LoadMask(Ext.getBody(), {msg: "Please wait..."});
The you have to configure your store listeners



...
listeners: {
beforeload: function(store, opt){
loadMask.show();
},
dataChanged: function(store) {
loadMask.hide();
}
}
...
In this way your mask will be display before your store ask for data to your server scripts, and it will be hide when the data load is completed.

Hope this helps.

babar.sajjad
22 Jan 2011, 8:09 AM
thanks Andrea for quick response
i get this error "Uncaught ReferenceError: loadMask is not defined"

babar.sajjad
22 Jan 2011, 8:10 AM
solved it thanks andrea :D

AndreaCammarata
22 Jan 2011, 8:11 AM
solved it thanks andrea :D

You are welcome babar ;)

maya11
23 Jan 2011, 7:12 AM
andreacammarata you are a good man :)

vani89
3 Feb 2012, 8:52 PM
:) thank you for help