Results 1 to 8 of 8

Thread: B3: ListPaging noMoreRecordsText not appearing if no records returned from server.

    Looks like we can't reproduce the issue or there's a problem in the test case provided.
  1. #1
    Sencha User
    Join Date
    Apr 2011
    Posts
    212

    Default B3: ListPaging noMoreRecordsText not appearing if no records returned from server.

    The ListPaging loadMoreText message is displayed on the list along with the emptyText message even though no records are returned from the server and the total records in the metaData is 0. The loadMoreText message is never replaced by the noMoreRecordsText message.

    It also seems odd that the emptyText message and loadMoreText messages are displayed at the same time.

    Json returned from server:
    Code:
    {"metaData":{"success":true,"total":0,"message":"No items were found."}}
    Ajax proxy:
    Code:
        ...
        reader: {
            type: 'json',
            rootProperty: 'items',
            totalProperty: 'total',
            successProperty: 'success',
            messageProperty: 'message',
        },
        ...
    Controller:
    Code:
        ...
        // Setup the auto paging
        itemList.query('list')[0].setPlugins({
            xclass: 'Ext.plugin.ListPaging', // Reference plugin by class
            autoPaging: false // Use a button instead of auto loading
        });
        ...

  2. #2
    Sencha Premium User mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    40,448

    Default

    I can confirm that the noMoreRecordsText is working as expected

    Screen Shot 2012-02-15 at 10.14.42 AM.jpg

    That is using this code:

    Code:
    new Ext.Container({
        fullscreen : true,
        layout     : 'fit',
        items      : [
            {
                xtype     : 'list',
                itemTpl   : '{text}',
                emptyText : 'List Empty Text',
                store     : new Ext.data.Store({
                    fields   : ['text'],
                    autoLoad : true,
                    proxy    : {
                        type   : 'ajax',
                        url    : 'data/json.json',
                        reader : {
                            type         : 'json',
                            rootProperty : 'data'
                        }
                    }
                }),
                plugins : [
                    {
                        xclass            : 'Ext.plugin.ListPaging',
                        noMoreRecordsText : 'Plugin Empty Text'
                    }
                ]
            }
        ]
    });
    I do also think it is weird to have both the emptyText and noMoreRecordsText to display at the same time but if you are going to use the ListPaging plugin then you shouldn't specify the emptyText config on the list.
    Mitchell Simoens @LikelyMitch

    Check out my GitHub:
    https://github.com/mitchellsimoens

    Posts are my own, not any current, past or future employer's.

  3. #3
    Sencha User
    Join Date
    Apr 2011
    Posts
    212

    Default

    I can see one difference in that I'm setting the plugin on the list and not the container, but I'm following the example in the documentation.

    I'd like to see the metaData you are sending back that triggers the Plugin Empty Text to appear.

    The following does not seem to work:


    {"metaData":{"success":true,"total":0,"message":"No items were found."}}
    Thanks

  4. #4

    Default

    I would also like to see the json reponse data being sent back Mitchell. Do you think you could post this for us?

    I am having a similar issue where the list paging plugin constantly loads, even though the json response has returned false.


    Any insight would be appreciated.

  5. #5
    Sencha Premium User mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    40,448

    Default

    Simple JSON:

    Code:
    {
        "success" : true,
        "total" : 0,
        "data" : []
    }
    Mitchell Simoens @LikelyMitch

    Check out my GitHub:
    https://github.com/mitchellsimoens

    Posts are my own, not any current, past or future employer's.

  6. #6
    Sencha User
    Join Date
    Apr 2011
    Posts
    212

    Default

    At first, I thought the total count was set to the total number of records and never changed.

    Based on your response, I assume that the total count must be decremented by the limit each time next page is called. Is this true?

  7. #7

    Default

    Mitchell, Can you confirm this also works in 1.x

    ??

    Thanks.

  8. #8
    Sencha Premium User mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    40,448

    Default

    total is the total amount of records found, not how many are in the page.
    Mitchell Simoens @LikelyMitch

    Check out my GitHub:
    https://github.com/mitchellsimoens

    Posts are my own, not any current, past or future employer's.

Posting Permissions

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