총 행 수가 페이지 매김에 올바르게 표시되어 있지만 다음 단추를 클릭 할 때 페이지 매김이보기를 업데이트하지 않습니다.다음 단추를 클릭 할 때 페이지 매김이보기를 업데이트하지 않습니다.
나는 Sencha를 처음 사용했습니다. MySQL에서는 모든 행을 반환합니다. 그래서 나는 클라이언트 측에서 제한 할 수 있습니다. 백엔드에서 행을 제한하면 클라이언트 측에서 모든 행을 가질 수 없습니다.
보기 : List.js
/*** This view is an example list of people.
*/
Ext.define('CRUD.view.main.List', {
extend: 'Ext.grid.Panel',
xtype: 'home',
requires: [
'CRUD.store.Personnel'
],
title: 'Heroes',
plugins: [
Ext.create('Ext.grid.plugin.CellEditing', {
clicksToEdit: 1
})
],
layout: 'fit',
fullscreen: true,
store: {
type: 'personnel',
},
columns: [
{ text: 'Name', dataIndex: 'name', sortable: true, flex: 1 },
{ text: 'Email', dataIndex: 'email', sortable: true, flex: 1 },
{ text: 'Phone', dataIndex: 'phone', sortable: true, flex: 1 }
],
bbar: {
store: {
type: 'personnel',
},
xtype: 'pagingtoolbar',
displayInfo: true
},
// columns: [
// { text: 'Name', dataIndex: 'name', flex: 1 },
// { text: 'Email', dataIndex: 'email', flex: 1 },
// { text: 'Phone', dataIndex: 'phone', flex: 1 }
// ],
listeners: {
select: 'onItemSelected',
},
});
스토어 :
Ext.define('CRUD.store.Personnel', {
extend: 'Ext.data.Store',
alias: 'store.personnel',
model: 'CRUD.model.User',
id: 'list',
fields: [
'name', 'email', 'phone'
],
// data: [
// { name: 'Jean Luc', email: "[email protected]", phone: "555-111-1111" },
// { name: 'Worf', email: "[email protected]", phone: "555-222-2222" },
// { name: 'Deanna', email: "[email protected]", phone: "555-333-3333" },
// { name: 'Data', email: "[email protected]", phone: "555-444-4444" }
// ],
autoLoad: {
start: 0,
limit: itemsPerPage
},
buffered: true,
pageSize: itemsPerPage,
remoteSort: true,
proxy: {
type: 'jsonp', //cross domain calls - json parser
url: 'http://localhost:8080/list',
enablePaging: true,
reader: {
type: 'json',
totalProperty: 'total'
},
},
// proxy: {
// type: 'memory',
// reader: {
// type: 'json',
// }
// },
});
답장을 보내 주셔서 감사합니다. 사실, 교차 도메인 문제가 있습니다. 그래서 저는 JsonP를 사용하고 있습니다. 크로스 도메인 요청을 위해 Ajax가 작동하지 않습니다. –