Results 1 to 7 of 7

Thread: Pull Refresh Plugin

  1. #1
    Sencha User
    Join Date
    Aug 2011
    Posts
    206

    Default Pull Refresh Plugin

    The plugin seems to have the effect of duplicating all the entries in my list on each pull. 1st load of list from store gives to records, 2nd gives 20 record etc.

    How can I correct this? I assume the plugin is meant to be refreshing the list from the store, not adding to it again with the same content?

    Allister

  2. #2
    Sencha User
    Join Date
    Jun 2011
    Posts
    350

    Default

    Is your store configured with pageSize? on the server you should read the start and limit params and return subset of records. If you search the forum you will find bunch of threads on this.
    Bharat Nagwani
    Sencha Designer Development Team

  3. #3
    Sencha User
    Join Date
    Aug 2011
    Posts
    206

    Default

    Yes, I had pageSize set to 4
    my url is
    https://ajax.googleapis.com/ajax/ser.../uploads&num=4

    I searched the forum (both sencha 2 and architect). There was a reference to the same problem, referencing the need to have a unique store id. My store certainly has an id....

    Not sure what's needed.

    Allister

  4. #4

    Default

    I think you'll have better luck posting in the Sencha Touch forums.

    My initial thought is that perhaps your records do not have a unique idProperty so the library is unable to determine which records are already in the store and which are new?
    Jason Johnston
    @lojjic
    Sencha Architect Development Team

  5. #5
    Sencha User
    Join Date
    Aug 2011
    Posts
    206

    Default

    As I understand it, the model needs to have the idProperty set. I've done that, but still get duplicates on refresh...?

    Allister

  6. #6

    Default

    Fair enough, it was just a hunch. Like I said your best bet is to ask in the ST forums, that's where you'll find your experts on the subject.
    Jason Johnston
    @lojjic
    Sencha Architect Development Team

  7. #7
    Sencha User
    Join Date
    Aug 2011
    Posts
    206

    Default SOLVED

    OK - solved. You have to create a field on your model with the same id as on the model itself and map it to something like the title

    Code:
    Ext.define('MyApp.model.MyModel3', {
        extend: 'Ext.data.Model',
        alias: 'model.MyModel3',
        config: {
            idProperty: 'ArticleId',
            fields: [
                {
                    name: 'title'
                },
                {
                    name: 'content'
                },
                {
                    name: 'publishedDate',
                    type: 'date'
                },
                {
                    name: 'link'
                },
                {
                    name: 'contentSnippet'
                },
                {
                    mapping: 'title',
                    name: 'ArticleId'
                }
            ]
        }
    });

Posting Permissions

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