2
我有一个组合框,商店通过远程从服务器获取数据。我的问题是我的分页不起作用。这里是我的代码片段:EXTJS Remote Combobox
Ext.define('EmployeeModel', {
extend: 'Ext.data.Model',
fields: [
{name:'id', type:'int'},
{name:'fullname', type:'string'}
]
});
// remote store
var employeeStore= new Ext.data.Store(
{
model: 'EmployeeModel',
pageSize: 10,
proxy: {
url: '/schedule/home/EmployeeList',
params: {
'active_id': params
},
type: 'ajax',
autoLoad: true,
reader:
{
root: 'data',
totalProperty: 'total',
id: 'id',
type: 'json'
},
simpleSortMode: true
}
});
this.employeeBox = new Ext.form.ComboBox(
{
store: employeeStore,
displayField: 'fullname',
valueField: 'id',
typeAhead: false,
loadingText: 'Searching...',
triggerAction: 'all',
hiddenName: 'employee',
name: 'Employee Name',
fieldLabel: 'Employee',
selectOnFocus: true,
allowBlank: false,
anchor: '98%',
width: 370,
enableKeyEvents: true,
pageSize: true,
minListWidth: 220,
minChars: 2,
labelWidth: this.labelWidth,
resizable: false
});
我不知道所缺乏的,但正如我已经通过我复制并测试所有互联网搜索远,它仍然无法正常工作。
正如我所观察到的,它加载了结果但未分页。在我上面提到的URL中,它来自一个php文件,它从查询中返回一个“json_encode”数组。其中我的查询是每个按键获取角色。有什么我应该在我的查询?顺便说一句我使用symfony 1.4 – oneofakind
'http:// www.sencha.com/forum/topics-remote.php'是绝对分页 - 请参阅[此链接](http://www.picamatic.com/view/8854690_Untitled/ )如果你不相信:)我不知道交响乐,所以我不会告诉你如何去做。通常在SQL查询中进行远程分页。 – Krzysztof