extjs – 无限滚动不渲染

我正在尝试使用ExtJS4.1无限滚动功能.

正在进行ajax调用,返回数据,但只加载第一页.

我究竟做错了什么?当我向下滚动时没有任何反应.

我的代码:
商店:

Ext.define('BM.store.Tests', {
    extend: 'Ext.data.Store',
    model: 'BM.model.Test',

    storeId: 'Tests',
    buffered: true,
    leadingBufferZone: 50,
    pageSize: 25,
    purgePageCount: 0,
    autoLoad: true
});

代理在模型中:

proxy: {
    type: 'ajax',
    api: {
        create: '../webapp/tests/create',
        read: '../webapp/tests',
        update: '../webapp/tests/update'
    },
    reader: {
        type: 'json',
        root: 'tests',
        successProperty: 'success'
    }
}

网格:

Ext.define('BM.view.test.MacroList', {
    extend: 'Ext.grid.Panel',
    alias:'widget.macro-test-list',

    store: 'Tests',

//    loadMask: true,
//    selModel: {
//        pruneRemoved: false
//    },
//    viewConfig: {
//        trackOver: false
//    },

    verticalScroller: {
        numFromEdge: 5,
        trailingBufferZone: 10,
        leadingBufferZone: 20
    },

    initComponent: function() {

        this.columns = [
            {
                xtype: 'gridcolumn',
                dataIndex: 'name',
                text: 'Name'
            },
            {
                xtype: 'datecolumn',
                dataIndex: 'created',
                text: 'Date Created',
                format: 'd-M-Y'
            },
            {
                xtype: 'datecolumn',
                dataIndex: 'changed',
                text: 'Last Updated',
                format: 'd-M-Y'
            }
        ];
        this.callParent(arguments);
    }

我的实现与示例中的实现之间唯一不同的是,我的网格不会呈现给正文.
视口包含边框布局.
网格是西部地区面板的一部分:

{
    collapsible: true,
    region: 'west',
    xtype: 'macro',
    width: 500
}

宏面板:

Ext.define('BM.view.Macro', {
    extend: 'Ext.panel.Panel',
    alias: 'widget.macro',

    title: 'Tests',

    layout: {
        type: 'vbox',
        align: 'stretch'
    },
    items: [
    {
        id: "macro-test-list-id",
        xtype: 'macro-test-list',
        flex: 1
    },
    {
        id: "macro-report-panel-id",
        xtype: 'macro-report-list',
        title: false,
        flex: 1
    },
    {
        id: "macro-report-list-id-all",
        xtype: 'macro-report-list-all',
        flex: 1,
        hidden: true,
        layout: 'anchor'
    }
    ]
});

我尝试过很多东西,改变布局,给网格一个固定的高度等等……
什么都不起作用,向下滚动,网格不刷新.
另一条信息:数据库包含53条数据记录.我正在收到3个ajax调用,但只有前25个记录出现(按照我的要求).
有什么想法吗?

最佳答案 听起来您可能忘记将总属性放在服务器的JSON响应中.你的答案是否有这样的结构:

{
    "total": 53, 
    "tests": [(...)]
}

totalProperty名称在Reader配置中定义,默认为total.

http://docs.sencha.com/ext-js/4-1/#!/api/Ext.data.reader.Reader-cfg-totalProperty

点赞