我想加载与JSON数据网格和底部栏中的分页。分页工作与静态,但不是动态数据
我的分页正在加载,但不工作。同样,这对静态数据有效。
这是我拨弄静态数据,Fiddle_Static 这是我拨弄静态数据,Fiddle Dynamic 这里是我的代码。
var ItemsPerPage = 3;
Ext.create('Ext.data.Store', {
storeId: 'Store',
proxy :{
enablePaging: true,
type:'ajax',
url: 'data1.json',
reader:{
type:'json',
rootProperty:"root"
}
},
pageSize: ItemsPerPage,
autoLoad:true,
fields: ['Surname','Name','RollNo']
});
Ext.create('Ext.grid.Panel', {
title: 'Student',
store:Ext.data.StoreManager.lookup('Store'),
columns:
[
{ text : 'SName' , dataIndex: 'Surname' ,width : 100},
{ text : 'Name' , dataIndex: 'Name' ,width : 100},
{ text : 'RNum' , dataIndex: 'RollNo' ,width : 100}
],
width: 340,
height:250,
dockedItems: [{
xtype:'pagingtoolbar',
store:'Store',
dock: 'bottom',
displayInfo:true
}],
renderTo: document.body
});
任何人都可以请帮我解决这个问题。
enablePaging是Ext.data.proxy.Memory的属性,而不是Ext.data.proxy.Ajax。看看这个问题:https://stackoverflow.com/questions/31082315/locally-paging-on-extjs-5-store-of-type-ajax – RogerC
[本地分页的Extjs 5类型ajax商店]的可能重复( https://stackoverflow.com/questions/31082315/locally-paging-on-extjs-5-store-of-type-ajax) – RogerC