Sencha touch 2 Sencha touch 2带插件的列表分页

Sencha touch 2 Sencha touch 2带插件的列表分页,sencha-touch-2,paging,Sencha Touch 2,Paging,我有一个Ext.List项目,我想在其中应用分页,我发现了一个插件“Ext.plugin.ListPaging”。但它在我的解决方案中不起作用。我搜索了一些关于其用法的示例,发现唯一的区别是将数据加载到存储中。我的情况是这样的, Ext.define('MyApp.view.ListTemplate', { extend: 'Ext.List', config: { fullscreen: true, plugins: [ { xclass

我有一个Ext.List项目,我想在其中应用分页,我发现了一个插件“Ext.plugin.ListPaging”。但它在我的解决方案中不起作用。我搜索了一些关于其用法的示例,发现唯一的区别是将数据加载到存储中。我的情况是这样的,

Ext.define('MyApp.view.ListTemplate', {
extend: 'Ext.List',
config: {
    fullscreen: true,
    plugins: [
        {
            xclass: 'Ext.plugin.ListPaging',
            autoPaging: true
        }
    ]},
    itemTpl: '<div class="listContainer"><div class="listItemTitle">{listItemTitle}</div><div class="elapsedTime"><tpl if="listItemDate != null">{listItemDate}</tpl></div><div class="listItemDetail"><tpl if="listItemDetail != null">{listItemDetail}</tpl></div></div>'
 });


Ext.define('MyApp.store.ListStore', {
extend: 'Ext.data.Store',
config:
{
    model: 'MyApp.model.ListData',
    proxy: {
        id: 'ListStore',
        access: 'public'
    }
}
});
var myStore = Ext.getStore('ListStore');
myStore.setData(jsonData);
myStore.setPageSize(5);
myStore.sync();

在这种情况下,分页不起作用,有人知道吗?

试试这个,它与我使用的类似&它对我有效

Ext.define('MyApp.view.ListTemplate', {
extend: 'Ext.List',
requires: [
    'Ext.plugin.ListPaging'
    ],
config: {
    fullscreen: true,
    storeId: 'ListStore',
    plugins: [
        {
            type: 'listpaging',
            autoPaging: true
        }
    ]},
    itemTpl: '<div class="listContainer"><div class="listItemTitle">{listItemTitle}</div><div class="elapsedTime"><tpl if="listItemDate != null">{listItemDate}</tpl></div><div class="listItemDetail"><tpl if="listItemDetail != null">{listItemDetail}</tpl></div></div>'
 });


Ext.define('MyApp.store.ListStore', {
extend: 'Ext.data.Store',
config:
{
    model: 'MyApp.model.ListData',
    pageSize: 5,
    storeId: 'ListStore',
    proxy: {
        id: 'ListStore',
        pageParam: 'param' //very important the parameter you use in the server side for pagination
        url: 'somesite.com' //you dont seem to have specified a url
    }
}
});
Ext.define('MyApp.view.ListTemplate'{
扩展:“Ext.List”,
要求:[
'Ext.plugin.ListPaging'
],
配置:{
全屏:对,
storeId:'ListStore',
插件:[
{
键入:“listpaging”,
自动老化:真的吗
}
]},
itemTpl:“{listItemTitle}{listItemDate}{listItemDetail}”
});
Ext.define('MyApp.store.ListStore'{
扩展:“Ext.data.Store”,
配置:
{
模型:“MyApp.model.ListData”,
页面大小:5,
storeId:'ListStore',
代理:{
id:'列表存储',
pageParam:'param'//在服务器端用于分页的参数非常重要
url:'somesite.com'//您似乎没有指定url
}
}
});

我试着这样做:ListPaging插件只能处理远程加载的数据。下面是一个示例演示,我的商店也充满了远程数据,登录请求被发送到服务器,服务器将列表数据发送到客户端。此列表数据已填入我的存储。我遗漏了什么吗?检查远程服务器上的当前页面并返回结果?列表的配置中没有定义存储。