PDA

View Full Version : how to load a JsonStore with new parameters



shahab_et
31 Jan 2011, 12:02 AM
I have a Store that is defined like this and my grid panel is bound to it :


var status =1;

var ds = new Ext.data.JsonStore({
url: "/industrialWebClient/seam/resource/myresource?op=13&status="+status,
storeId: 'myStore',
fields: [
{name: 'id'},
{name: 'docNumber'},
{name: 'desc'},
{name: 'status'},
{name: 'statusDateStr'},
{name: 'version'}
],
root: 'rows',
totalProperty: 'totalCount'
});
and there is a toolbar :

var tbDocumentType = new Ext.Toolbar({
items: [
{
text: 'NonConfirmed',
id:'nonConfirmed-list',
handler: function() {
status =1;
grid.getStore().load();
},
},
{
text: 'Surveyed',
id:'nonConfirmed-Surveyed-list',
handler :function() {
status =2;
grid.getStore().load();
}
}
]
});
this toolbar is supposed to load data with different Status values (1 and 2 ) ,but its not working !!!

and here is the load method

ds.load({params: {start: 0, limit: myPageSize,status : status}});

shahab_et
31 Jan 2011, 4:35 AM
I changed :




grid.getStore().load();




to :



ds.load({params: {start: 0, limit: myPageSize,status : status}});



and the problem is solved !