【发布时间】:2015-04-01 18:48:42
【问题描述】:
我在使用组合框从数据库中选择项目时遇到了一些问题。 由于加载了 100 多个项目,我使用组合框底部的分页工具栏。 现在,如果页面大小设置为 5 或 50,分页工具栏会根据页面大小显示 20 的第 1 页或 2 的第 1 页,但组合框会显示所有 100 个项目,并且只需将它们复制到下一页,就像根本没有设置页面大小一样。 我尝试了几件事,但似乎没有任何效果。 怎么了?
{
xtype: 'combobox',
queryMode: 'local',
valueField: 'id',
fieldLabel: 'Description SKU',
name: 'id_fk',
pageSize: 5,
width: 400,
padding: 5,
store: Ext.create('Ext.data.Store',
{
fields: ['id','key item','description'],
autoLoad: true,
pageSize: 5,
proxy:
{
type: 'ajax',
url: 'items/load',
reader:
{
type: 'json',
root: 'data'
}
}
}),
tpl: Ext.create('Ext.XTemplate',
'<tpl for=".">',
'<div class="x-boundlist-item">{key item} - {description}</div>',
'</tpl>'),
displayTpl: Ext.create('Ext.XTemplate',
'<tpl for=".">',
'{key item} - {description}',
'</tpl>'
)
}
【问题讨论】: