Extjs 无限滚动不渲染
我正在尝试使用ExtJS4.1无限滚动功能。Extjs 无限滚动不渲染,extjs,grid,extjs4.1,infinite-scroll,Extjs,Grid,Extjs4.1,Infinite Scroll,我正在尝试使用ExtJS4.1无限滚动功能。 正在进行ajax调用,返回数据,但仅加载第一页。 我做错了什么?当我向下滚动时,什么也没有发生 我的代码: 商店: 代理位于模型中: proxy: { type: 'ajax', api: { create: '../webapp/tests/create', read: '../webapp/tests', update: '../webapp/tests/update' },
正在进行ajax调用,返回数据,但仅加载第一页。
我做错了什么?当我向下滚动时,什么也没有发生 我的代码:
商店: 代理位于模型中:
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
属性。你的答案是否有这样的结构:
{
"total": 53,
"tests": [(...)]
}
totalProperty
名称在读卡器配置中定义,默认为total
您需要升级到ExtJS 4.2 事实并非如此。你在医生的哪里看到需要它?抱歉,totalProperty默认为“total”,编辑了上面的答案。Sencha在隐藏如此重要功能方面的能力令人惊讶。如果这有效,我将连续7次接受你的答案。:)不幸的是,这仍然不起作用。如果我给它以下参数:
buffered:true,leadingBufferZone:75,pageSize:25
它会预先加载整个数据库。在任何其他情况下,如果前导缓冲区小于57,或未定义,加载掩码不会消失,它将永远加载存储,并停留在最后一页。您使用的是哪个版本的ExtJS?我在4.0中看到了一个类似的问题,但在4.1中没有复制。
{
"total": 53,
"tests": [(...)]
}