Results 1 to 4 of 4

Thread: Listpaging plugin does not show 'noMoreRecordsText' in ST 2.2

  1. #1
    Sencha User
    Join Date
    Dec 2012
    Posts
    77
    Answers
    6
    Vote Rating
    2
      0  

    Default Answered: Listpaging plugin does not show 'noMoreRecordsText' in ST 2.2

    I recently upgraded to ST 2.2 in the hopes that there are improvements for lists. I am using the listpaging plugin and everything is working well except for one thing. When there are no more records to load, the text "Load More..." never changes to display that there are no more records available.

    Here is my code:

    Code:
    xtype: 'list',
                    itemId: 'myListings',
    				store: 'products',
                    cls: 'product-list',
                    onItemDisclosure: true,
                    disableSelection: true,
                    itemHeight: '80px',
                    variableHeights: false,
                    flex: 1,
                    ui: 'round',
                    itemTpl: "{product_name}",
                    plugins: [
                        {
                            type: 'listpaging',
                            autoPaging: true
                        }
                    ]

  2. I was able to get this working by providing the correct count from the server side. It now paginates and shows the 'no more records' text correctly on both iOS and Android. The trick was to map the totalProperty to the correct count variable. And, as for mapping to a count variable in the heirarchy of the JSON response data, it can be mapped anywhere with a proper path irrespective of the rootProperty.

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

    Default

    That text should show if you are returning the total number of records and the store knows it's on the last page. This should equate to true if it's on the last page:

    Code:
    store.getTotalCount() <= (store.currentPage * store.getPageSize())
    Mitchell Simoens @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it! Checkout the CODE tag!

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

  4. #3
    Sencha User
    Join Date
    Dec 2012
    Posts
    77
    Answers
    6
    Vote Rating
    2
      0  

    Default

    Thanks mitchell for the hint. I had a look through the docs and saw that there was a way to specify a totalProperty on the reader. I did that and noticed that your statement still returns false. My totalProperty is above in the hierarchy of returned data then the rootProperty that I have set. Is it possible this is why it is not being set?

    Code:
    storeId: 'products',
            model: 'MyApp.model.Product',
            pageSize: 5,
            proxy: {
                type: 'ajax',
                method: 'GET',
                url: 'http://localhost/products',
                startParam: 'offset',
                reader: {
                    type: 'json',
                    rootProperty: 'data.products.entries',
                    totalProperty: 'data.count'
                }

  5. #4
    Sencha User
    Join Date
    Dec 2012
    Posts
    77
    Answers
    6
    Vote Rating
    2
      0  

    Default

    I was able to get this working by providing the correct count from the server side. It now paginates and shows the 'no more records' text correctly on both iOS and Android. The trick was to map the totalProperty to the correct count variable. And, as for mapping to a count variable in the heirarchy of the JSON response data, it can be mapped anywhere with a proper path irrespective of the rootProperty.

Tags for this Thread

Posting Permissions

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