PDA

View Full Version : How to render Store content again ?



Anup Rana
8 Nov 2010, 5:55 AM
I want the store to hit the database again and fetch the value from the database.
Can any1 help me...dis is my code.

Ext.onReady(function()
{

UserElemStore = new Ext.data.JsonStore({
url : 'LoadData.action?storeVal=UEle',
remoteSort : false,
root : 'list',
idProperty : 'userEle',
fields : ['elements'],
autoLoad : true
});

UserElemStore.load();
});

plalx
8 Nov 2010, 6:37 AM
You can either call store.load() or store.reload(). Setting the autoLoad config option to true (like you did) will cause the store to get loaded as soon as it's instanciated so you don't need this line
UserElemStore.load();

Anup Rana
9 Nov 2010, 1:44 AM
Ya but i want the store to populate again.i.e it should call the same URL again.How can i achieve this ?

plalx
9 Nov 2010, 5:56 AM
Everytime you make a call to store.load() or store.reload() it will make a round trip to the server (call the url...)

Anup Rana
9 Nov 2010, 6:16 AM
No by calling store.load() or store.reload() it is not going to the server to populate the latest data.

plalx
9 Nov 2010, 6:20 AM
It should... What it does when calling load()? You don't see any request made to the server in firebug?

Anup Rana
10 Nov 2010, 9:35 PM
Thanx budddy...it worked... :)