Looks like we can't reproduce the issue or there's a problem in the test case provided.
-
Sencha User
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
});
...
-
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.
-
Sencha User
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
-
Sencha User
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.
-
Simple JSON:
Code:
{
"success" : true,
"total" : 0,
"data" : []
}
-
Sencha User
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?
-
Sencha User
Mitchell, Can you confirm this also works in 1.x
??
Thanks.
-
total is the total amount of records found, not how many are in the page.