0
私は以下のコードを使用しています。私はグリッドを参照して、コンテンツは正しいが、ページャのセクションは奇妙です。ExtJS:ページングが機能していません。リフレッシュボタン
- 「次へ」、「前へ」などのボタンは有効になっていません。 4つのレコードがあり、ページごとに3つのレコードを尋ねると、「ページ1/2」が表示されます。
- 「更新」ボタンを管理するにはどうすればよいですか。
おかげで、
$(document).ready(function() {
Ext.define('User', {
extend: 'Ext.data.Model',
fields: [
{ name: 'FirstName', type: 'string' },
{ name: 'LastName', type: 'string' },
{ name: 'Email', type: 'string' }
]
})
var userStore = Ext.create('Ext.data.Store', {
model: 'User',
proxy: {
type: 'ajax',
url: '/Home/GetUsers',
reader: {
type: 'json',
root: 'users'
}
},
autoLoad: true
});
Ext.create('Ext.grid.Panel', {
renderTo: 'testing',
store: userStore,
autoScroll: true,
layout: 'fit',
title: 'Users',
width:450,
columns: [{
text: 'First Name',
width: 225,
sortable: true,
dataIndex: 'FirstName',
editor: {
xtype: 'textfield',
allowBlank: false
}
},
{
text: 'Last Name',
width: 225,
sortable: true,
dataIndex: 'LastName',
editor: {
xtype: 'textfield',
allowBlank: false
}
}],
bbar : Ext.create('Ext.toolbar.Paging', {
store: userStore,
pageSize: 3,
displayInfo: true,
displayMsg: 'Displaying topics {0} - {1} of {2}',
emptyMsg: "No topics to display"
})
});
});
アップデート1:
{"total":2,"success":true,"data":[{"Id":1,"FirstName":"AA","LastName":"BB"},{"Id":2,"FirstName":"CC","LastName":"DD"},{},{}]}
私はまだ「私はドン
ページ番号はjsfiddleと同じコードで空ですが、私はExtJS 4.1を使用しています –
このコードをjsfiddleに貼り付ける前に、私自身のJSONデータプロバイダでExt 4.1のローカルWebサーバーでテストしました。 –
私の更新が追加されましたJSON –