Results 1 to 9 of 9

Thread: sencha touch store

  1. #1
    Sencha User omari_yousef's Avatar
    Join Date
    Jul 2010
    Posts
    105
    Vote Rating
    0
      0  

    Default Answered: sencha touch store

    how can I load the next page in the store without remove the prev page?

  2. I meant which ST2 version (PR2, PR3, RC1 or the latest one).
    However, I see you are not using the "nextPage()" function to load your store next page, so the "clearOnPageLoad" config is useless.

    You can try to set the "addRecords" option to true when you load the new data like follows:

    Code:
    Store.load({
        addRecords: true,
        params: {
            "provider": 'grid',
            "root": "index",
            "params": {
                "0": "0",
                "1": "3"
            },
            "start": Sale.Start,
            "limit": Sale.Limit
        }
    });

  3. #2
    Sencha - Services Team AndreaCammarata's Avatar
    Join Date
    Jun 2009
    Location
    Italy
    Posts
    1,395
    Answers
    148
    Vote Rating
    24
      0  

    Default

    You only need to set the "clearOnPageLoad" property of your store to false (which is set to True by default) to keep existing records on page load.

    Hope this helps.
    Sencha Inc
    Andrea Cammarata, Solutions Engineer
    Owner at SIMACS

    @AndreaCammarata
    www.andreacammarata.com
    github: https://github.com/AndreaCammarata

    TUX components bundle for Sencha Touch 2.x.x
    https://github.com/AndreaCammarata/TUX


  4. #3
    Sencha User omari_yousef's Avatar
    Join Date
    Jul 2010
    Posts
    105
    Vote Rating
    0
      0  

    Default

    no it don't work >>> I try it before

  5. #4
    Sencha - Services Team AndreaCammarata's Avatar
    Join Date
    Jun 2009
    Location
    Italy
    Posts
    1,395
    Answers
    148
    Vote Rating
    24
      0  

    Default

    Quote Originally Posted by omari_yousef View Post
    no it don't work >>> I try it before
    Which version of ST2 are you working on?
    Sencha Inc
    Andrea Cammarata, Solutions Engineer
    Owner at SIMACS

    @AndreaCammarata
    www.andreacammarata.com
    github: https://github.com/AndreaCammarata

    TUX components bundle for Sencha Touch 2.x.x
    https://github.com/AndreaCammarata/TUX


  6. #5
    Sencha User omari_yousef's Avatar
    Join Date
    Jul 2010
    Posts
    105
    Vote Rating
    0
      0  

    Default

    sencha touch 2 yes

  7. #6
    Sencha User omari_yousef's Avatar
    Join Date
    Jul 2010
    Posts
    105
    Vote Rating
    0
      0  

    Default

    here is my store

    Code:
    Ext.define('Sale.store.GridStore',{
        extend:'Ext.data.Store',
        
        xtype:'GridStore',
       
        config:{ 
          model   : 'Sale.model.GridModel',
          clearOnPageLoad:false,
         autoLoad:true,
          // sorters: 'lastName',
            
         proxy : {
            type : 'direct',
            directFn : IDataService.getdata,
            reader : {
                    type : 'json',
                    rootProperty : 'index.rows'
            }
        },
        
        }        
    });

    and here how i load the next page

    Code:
    Store.load({params:{"provider":'grid',"root":"index","params":{"0":"0" ,"1":"3"}  ,"start":Sale.Start,"limit":Sale.Limit}});

  8. #7
    Sencha - Services Team AndreaCammarata's Avatar
    Join Date
    Jun 2009
    Location
    Italy
    Posts
    1,395
    Answers
    148
    Vote Rating
    24
      0  

    Default

    I meant which ST2 version (PR2, PR3, RC1 or the latest one).
    However, I see you are not using the "nextPage()" function to load your store next page, so the "clearOnPageLoad" config is useless.

    You can try to set the "addRecords" option to true when you load the new data like follows:

    Code:
    Store.load({
        addRecords: true,
        params: {
            "provider": 'grid',
            "root": "index",
            "params": {
                "0": "0",
                "1": "3"
            },
            "start": Sale.Start,
            "limit": Sale.Limit
        }
    });
    Sencha Inc
    Andrea Cammarata, Solutions Engineer
    Owner at SIMACS

    @AndreaCammarata
    www.andreacammarata.com
    github: https://github.com/AndreaCammarata

    TUX components bundle for Sencha Touch 2.x.x
    https://github.com/AndreaCammarata/TUX


  9. #8
    Sencha User omari_yousef's Avatar
    Join Date
    Jul 2010
    Posts
    105
    Vote Rating
    0
      0  

    Default

    it's work thaaanx

  10. #9
    Sencha - Services Team AndreaCammarata's Avatar
    Join Date
    Jun 2009
    Location
    Italy
    Posts
    1,395
    Answers
    148
    Vote Rating
    24
      0  

    Default

    Quote Originally Posted by omari_yousef View Post
    it's work thaaanx
    You are welcome.
    Please don't forget to set the question as answered.
    Sencha Inc
    Andrea Cammarata, Solutions Engineer
    Owner at SIMACS

    @AndreaCammarata
    www.andreacammarata.com
    github: https://github.com/AndreaCammarata

    TUX components bundle for Sencha Touch 2.x.x
    https://github.com/AndreaCammarata/TUX


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •