1. #1
    Sencha User
    Join Date
    Dec 2012
    Posts
    77
    Answers
    6
    Vote Rating
    2
    azamatoak is on a distinguished road

      0  

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

    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 - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    36,756
    Answers
    3462
    Vote Rating
    828
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      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 @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    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
    Dec 2012
    Posts
    77
    Answers
    6
    Vote Rating
    2
    azamatoak is on a distinguished road

      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
    azamatoak is on a distinguished road

      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.

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..." hd porno faketaxi