Threaded View

  1. #1
    Sencha User
    Join Date
    Mar 2013
    Posts
    4
    Vote Rating
    0
    Answers
    1
    ivan92 is on a distinguished road

      0  

    Default Answered: Get ListStore from a local paging Grid

    Answered: Get ListStore from a local paging Grid


    Hi:

    I have a problem with getting the list of all items of my editable local paging grid (After edit, of course). When i type:
    Code:
    listStore.getModels()
    Only return the items that are shown on the current page of the grid. I need to get all the item at all the pages. (i dont know if i can get all complete list or i have to get one page-list at a time)
    I am using this to implements the paging:
    Code:
        List<Facultad> res = new ArrayList<Facultad>();        
        PagingModelMemoryProxy proxy = new PagingModelMemoryProxy(res);
        PagingLoader<PagingLoadResult<ModelData>> loader = new BasePagingLoader<PagingLoadResult<ModelData>>(proxy);
        ListStore<Facultad> listStore= new ListStore<Facultad>(loader);
        PagingToolBar toolBar = new PagingToolBar(10);
        .
        .
        .
        (OTHER CODE)
        .
        .
        .
        //"resultado" is the list that i get from a RPC call to reload the grid
        public void reloadGrid(List<Facultad> resultado) {
            proxy = new PagingModelMemoryProxy(resultado);
            loader = new BasePagingLoader<PagingLoadResult<ModelData>>(proxy);
            loader.setRemoteSort(true);
            listStore= new ListStore<Facultad>(loader);
    
            toolBar.bind(loader);
            loader.load(0, 10);
    
            grid.reconfigure(listStore, cm);
        }
    Thanks for your time!

  2. solved the problem with this:
    Code:
    for (int i = 1; i <= toolBar.getTotalPages(); i++) {   
         toolBar.setActivePage(i);
         myTotalList.addAll(grid.getStore().getModels());                                 
    }

Thread Participants: 1

Tags for this Thread