Page 1 of 2 12 LastLast
Results 1 to 10 of 13

Thread: pull and refresh plugin redefined

  1. #1
    Sencha User
    Join Date
    Feb 2012
    Posts
    253
    Vote Rating
    0
      0  

    Default Answered: pull and refresh plugin redefined

    How could I override the pull&refresh plugin of Lists
    in order to clear the store before?

    thx
    Ps: 2 typos in the doc, setExtraParams in http://docs.sencha.com/touch/2-0/#!/...-setExtraParam, and rootProperty in http://docs.sencha.com/touch/2-0/#!/....reader.Reader (the example)

  2. if publisherID is the "id" of the record then you can set the idProperty to it in your model:

    Code:
    config : {
        idProperty : 'publisherID',
        ...
    }

  3. #2
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,330
    Answers
    3884
    Vote Rating
    1297
      0  

    Default

    You will need to create an override or extension of the plugin to change it's behavior.

    setExtraParam is a valid method. It is different than setExtraParams.

    The example that has root does need to get fixed.
    Mitchell Simoens @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it!

    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

  4. #3
    Sencha User
    Join Date
    Feb 2012
    Posts
    253
    Vote Rating
    0
      0  

    Default

    Is there some event triggered by this plugin

    I wanted to use beforeload event and empty the store, but beforeload or load are not triggered by this plugin

  5. #4
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,330
    Answers
    3884
    Vote Rating
    1297
      0  

    Default

    The pull refresh plugin doesn't actually do anything on your store. It has it's own Ext.data.Operation load the data and then iterates through it. If a matching record is found in the store then it will update the data. If a match is not found it will add the record to the store.
    Mitchell Simoens @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it!

    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

  6. #5
    Sencha User
    Join Date
    Feb 2012
    Posts
    253
    Vote Rating
    0
      0  

    Default

    In my case, my proxy data doesn't change but everytime I trigger the plugin, it loads the remote data, so I have duplicate entries, triples .... I will try to debug the plugin to see where it fails

  7. #6
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,330
    Answers
    3884
    Vote Rating
    1297
      0  

    Default

    do you have a value for the idProperty? Like does your model get an id from your response or is it created by Sencha Touch?
    Mitchell Simoens @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it!

    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

  8. #7
    Sencha User
    Join Date
    Feb 2012
    Posts
    253
    Vote Rating
    0
      0  

    Default

    No Im using a basic store with model and ajaxproxy (rootProperty is set)

  9. #8
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,330
    Answers
    3884
    Vote Rating
    1297
      0  

    Default

    The pullrefresh model will attempt to make a match based on the id of the records.
    Mitchell Simoens @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it!

    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

  10. #9
    Sencha User
    Join Date
    Feb 2012
    Posts
    253
    Vote Rating
    0
      0  

    Default

    My records have id's like ext-record-19, autogenerated , I need to override 'id' for the data records?

  11. #10
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,330
    Answers
    3884
    Vote Rating
    1297
      0  

    Default

    Yes, Sencha Touch is then providing ids for you which means the plugin won't find matches. Your server needs to return an id for each record.
    Mitchell Simoens @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it!

    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

Page 1 of 2 12 LastLast

Posting Permissions

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