1. #1
    Ext User
    Join Date
    Jun 2008
    Posts
    24
    Vote Rating
    0
    noah17 is on a distinguished road

      0  

    Default Grid, data store and paging

    Grid, data store and paging


    1. Does the dataStore>-limit must be equal to the bbar->pageSize ?
    2. How can I load according to the dataStore>-limit but show according to thebbar->pageSize ?


    gridStore.load({
    params:{start:0, limit:100},
    callback: function( r, options, success){
    grid.getSelectionModel().selectFirstRow();
    }
    });


    bbar: new Ext.PagingToolbar({
    pageSize: '10',
    store: gridStore,
    //displayInfo: true,
    displayMsg: 'Displaying {0} - {1} of {2}',
    emptyMsg: "No candidates"
    }),




    Thanks

  2. #2
    jay@moduscreate.com's Avatar
    Join Date
    Mar 2007
    Location
    Frederick MD, NYC, DC
    Posts
    16,361
    Vote Rating
    81
    jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all

      0  

    Default


    page size is how many records per page. so 10 would equal 10 records per one page.


    Don't manage limit, let the paging toolbar do that.

  3. #3
    Ext User
    Join Date
    Jun 2008
    Posts
    24
    Vote Rating
    0
    noah17 is on a distinguished road

      0  

    Default


    Let me be more clearly, I want to load the all data (100 records) and do local sort, but in the same showing only 10 records (paging).


    1. How do I load the entire data with the dataSort ? should I use:

    reader: new Ext.data.JsonReader({
    root: 'candidates',
    totalProperty: 100

    2.
    shuld I just load the data each time without the limit param ?

    gridStore.load({
    //params:{start:0, limit:total_count},

    callback: function( r, options, success){
    grid.getSelectionModel().selectFirstRow();
    }
    });

    Thanks for your help

  4. #4
    Ext User
    Join Date
    Jul 2007
    Location
    Florida
    Posts
    9,996
    Vote Rating
    6
    mjlecomte will become famous soon enough mjlecomte will become famous soon enough

      0  

    Default


    pagesize and limit are basically the same, how many records are shown per page.

    You want to grab all records at once and store that data locally and then page through I take it. To do that you need to use an extension, paging memory proxy. Search and ye shall find (easily).

  5. #5
    Ext User
    Join Date
    Jun 2008
    Posts
    24
    Vote Rating
    0
    noah17 is on a distinguished road

      0  

    Default


    What about the totalProperty ?

    reader: new Ext.data.JsonReader({
    root: 'candidates',
    totalProperty: 100

  6. #6
    Ext User
    Join Date
    Jul 2007
    Location
    Florida
    Posts
    9,996
    Vote Rating
    6
    mjlecomte will become famous soon enough mjlecomte will become famous soon enough

      0  

    Default


    Read the API it tells you what it is:
    http://extjs.com/deploy/dev/docs/?cl...=totalProperty

    There's an example at top of page even?

  7. #7
    Ext User
    Join Date
    Jun 2008
    Posts
    24
    Vote Rating
    0
    noah17 is on a distinguished road

      0  

    Default


    Thanks for your help