Ext.onReady(function () {
var itemsPerPage = 2; // set the number of items you want per page var store1 = Ext.create('Ext.data.Store', {
id: 'simpsonsStore',
// autoLoad:{ start: 0, limit: itemsPerPage },
fields: [
{ name: 'Czybm', mapping: 'Czybm' },
{ name: 'Czymc' },
{ name: 'Ssdw' },
{ name: 'Ssdwmc' },
{ name: 'Gw' },
{ name: 'Gwmc' },
{ name: 'Pass' },
{ name: 'Scsysj' },
{ name: 'Zhsjsj' },
{ name: 'Zhxjsj' },
{ name: 'Pxh' },
{ name: 'Yxbj' },
{ name: 'Jsbh' },
{ name: 'Jsbhmc' }
],
pageSize: itemsPerPage,
data: { 'items':
[
{ "Czybm": "caiwu", "Czymc": "财务", "Ssdw": "7550", "Ssdwmc": "兰州石化公司", "Gw": "02", "Gwmc": "财务", "Pass": "1", "Scsysj": null, "Zhsjsj": null, "Zhxjsj": null, "Pxh": 10, "Yxbj": "1", "Jsbh": "admin", "Jsbhmc": "系统管理员" },
{ "Czybm": "123", "Czymc": "33", "Ssdw": "7550", "Ssdwmc": "兰州石化公司", "Gw": "02", "Gwmc": "财务", "Pass": "32", "Scsysj": null, "Zhsjsj": null, "Zhxjsj": null, "Pxh": 100, "Yxbj": "1", "Jsbh": "admin", "Jsbhmc": "系统管理员" },
{ "Czybm": "cx", "Czymc": "查询", "Ssdw": "755000010106", "Ssdwmc": "财务处", "Gw": "01", "Gwmc": "计划排产", "Pass": "1", "Scsysj": null, "Zhsjsj": null, "Zhxjsj": null, "Pxh": 130, "Yxbj": "1", "Jsbh": "admin", "Jsbhmc": "系统管理员" }
]
},
proxy: {
type: 'memory',
reader: {
//type: 'ajax',
root: 'items',
pageSize: itemsPerPage,
totalProperty: 3
}
}
});
Ext.create('Ext.grid.Panel', {
title: 'Simpsons',
store: store1,
columns: [
{ header: '操作员编码', dataIndex: 'Czybm' },
{ header: '操作员名称', dataIndex: 'Czymc' },
{ header: '所属单位', dataIndex: 'Ssdw' },
{ header: '所属单位名称', dataIndex: 'Ssdwmc' },
{ header: '岗位', dataIndex: 'Gw' },
{ header: '岗位名称', dataIndex: 'Gwmc' },
{ header: '操作员口令', dataIndex: 'Pass' },
{ header: '上次使用时间', dataIndex: 'Scsysj' },
{ header: '最后上机时间', dataIndex: 'Zhsjsj' },
{ header: '最后下机时间', dataIndex: 'Zhxjsj' },
{ header: '排序号', dataIndex: 'Pxh' },
{ header: '有效标记', dataIndex: 'Yxbj' },
{ header: '角色编号', dataIndex: 'Jsbh' },
{ header: '角色编号名称', dataIndex: 'Jsbhmc' }
],
autoWidth:true,
height: 225,
// dockedItems: [{
// xtype: 'pagingtoolbar',
// store: store,
// dock: 'bottom',
// displayInfo: true
bbar:Ext.create('Ext.PagingToolbar', {
store: store1,
displayInfo: true
// emptyMsg: "No topics to display"
}),
renderTo: 'divGrv'
});
// specify segment of data you want to load using params
store1.load({
params: {
start: 0,
limit: 1
}
});
});谁知道是怎么回事啊!!!
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货