Problem with Pagination

  • Hi All

    I am having some problem in implementing Pagination. I am able to have Paging Bar on the Grid with checkbox selection model. I am also able to return the paged data from server to the Grid. But i am not able to maintain the state of checkboxes. To put it in other words, say the user first gets a set of 20 records from the server, then the user selects some records on the grid by selecting their check box. Now when the user request for the next set of records by clicking on next button, the previous selected records are lost. I understand that before loading the store we have to fetch the selected records and store them in session but i don't understand how to fetch the selected records in grid on the server side.
    As in the request the parameters which gets passed are start, limit ,sort etc, is there any way through which i can pass the selected records as well. I am using Java for server side implementation.

    Please help me out on this:-/

    Thanks in advance.


  • Use:

    onBeforeLoad : function(store , options){
    options.params = Ext.apply(options.params {}, {items:this.checkedItems});
    }


  • Hi

    Thanks for your reply. I am doing exactly that. I have written a handler for beforeload event and in that i am saving the selections. But how to pass these selections to the server?
    I tried passing params like this:

    //handler for beforeload event
    onBeforeLoad : function(store , options){
    //logic to get selections in var checkedItems
    options.params = {items:this.checkedItems};
    }
    But then it is removing start and limit parameters.

    Please suggest how can i pass the parameter in additon to start and limit to the server.

    Thanks...


  • try:
    Ext.apply(options.params, {
    items : this.checkedItems
    });

    or more simply: options.params.items = this.checkedItems.


  • generally during page flips, selection is lost. you'll need to setup something on 'beforeload' of the store, to store the selections, then reapply them if the page is returned.







  • #If you have any other info about this subject , Please add it free.#
    Your name:
    E-mail:
    Telphone:

    Your comments:


    If you have any other info about Problem with Pagination , Please add it free.