Overriding store's load method

Overriding store's load method

I used a javascript function to override the load method of the JsonStore that my GridPanel uses. In that function, I filter the store according to the parameters sent to it which is like,

{'params' : {'start' : '0', 'limit' : '16'}}

start - the index of the next record needed in the store
limit - maximum records that are to be shown in a page

So, the grid displays the filtered records and, voila ! I see the next page.

But, there is a problem. The paging toolbar is unaffected.
That is,
- The page number on the middle of the paging bar is still unchanged, namely, '1'.
- The previous page button and the first page button or still disabled.

So, there is something more to be done here.
Any idea what is it that I am missing ?

By the way, there was no callback function in the parameters sent to the load method of the JsonStore.
Any idea why ?

Last edited by arunknathan; 13 Jan 2009 at 5:29 AM.
Reason: Adding more detail to the issue

Thanks for the help

Thanks for the help

@Mjlecomte:

No, I am using a JsonStore which has a HttpProxy and JsonReader configured internally.
But, the store is just a local store so it doesn't have any 'url' in its config options.
Anyways, I will try to use MemoryProxy also and see if that works good for me.

@Lonny Zone:

I will try to extend DataProxy.
But, I do have a doubt though.
Isn't it possible to accomplish the same using a JsonStore ?

For say,

Code:

var jsonStore1 = new Ext.data.JsonStore({

root : 'someRecords',
fields : ['record']

});
jsonStore1.load = function(params){

/*
Use the params to filter the records of the store so that the grid
displays only the records of the requested page.
*/

}

As I have posted earlier the load method is invoked by the paging toolbar but the paging toolbar is not updated about the page transition. Also the 'params' in the load method doesn't contain any callback function object in it.

There is definitely something wierd here.
Any idea on why there is no callback function object in params ?

Paging is not working.

Paging is not working.

I am facing similar problem.
I have some questions on this. I will really appriciate if somebody answers my questions.

1) To implement pagination in extjs, do we alway require to create proxy in jstonstore object?
2) I have to implement pagination on the static data object. I have pasted the code below. However, I am not sure whether i will have to create proxy (HTTPproxy or ..) for it. If yes, how to do it. If somebody give me the right url or paste the sample example here that would be really apriciated.