开发者

Modify params(query) from Grid Paging next button

I'm having some paging issues when I wan't to display the next page with the "next button" from m paging toolbar.

I'm using a form search to display data in my grid, which send along "start" and "limit" params a query (my search more precisely).

listeners: {
    keyup: function(el,type){
        var searchQuery = el.getValue();      //Get the value from the textfield 
        store.load({
            params: {
                start: 0,
                limit: 5,
                query: searchQuery
            }
        });
    }
}

Let's say I was searc开发者_运维技巧hing for "Apple", the server side script is called like this :

serverSideScript.jsp?query=Apple&start=0&limit=5

So now, the problem is that the next button only send start & limit. Where can I overwrite the load method used by all paging buttons in order to add my personal param.

Thanks in advance for your help. TheRainFall.


One way to do it is to use beforeload listener of the store to fetch any required data and add it to parameters

beforeload: function(store) {
  store.baseParams.query = getSearchQuery();
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜