PDA

View Full Version : What is the difference? Ext.data.Store



franzisk
12 May 2007, 6:15 AM
What is the difference between this:


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

and


ds.baseParams = {"filter_col":filterCol,
"filter_name":value,
"filter_type":filterType,
"search_cols":strCols};
ds.load({params:{start: paging.cursor, limit: paging.pageSize}});

Animal
12 May 2007, 6:24 AM
baseParams are sent with every request.

If you create a PagingToolbar (see docs), it will use the last "limit" sent when it requests subsequent pages, but it knows nothing about any other params your server may need. Those other params should be in baseParams.

franzisk
12 May 2007, 6:32 AM
Ok, that's my problem.

Suppose I have my grid completed and than I want to send another query (by clicking in a menu item on a toolbar) and this time I need to send some params (ie: "filter_name"), do I need to call ds.load(..), call ds.baseParamns(...) or both?

Animal
12 May 2007, 6:46 AM
You want to requery the database, and reload the grid with the results of the new query? So these params are just for the initial load?

I think you just need



ds.load({
params:{
start: 0;
limit: // whatever number of records per page you want
"filter_col":filterCol,
"filter_name":value,
"filter_type":filterType,
"search_cols":strCols
}
});