我想加載與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