我注意到在某些或我的网格上没有显示“displayMsg”。即右下角的文字。
如果你看下面的屏幕截图,我已经设置了 pageSize: 4. 总共有“33”条记录,所以应该开始分页。一般来说,分页不显示记录总数的原因是什么。
Ext.define('Mis.view.PurchaseOrder', {
extend: 'Ext.grid.Panel',
alias:'widget.purchaseorder',
title:'Purchase Order',
store:'MaterialPurchaseOrders',
height: 235,
dockedItems:[
{
xtype: 'pagingtoolbar',
store:'MaterialPurchaseOrders',
dock: 'bottom',
displayInfo: true,
displayMsg:'Displaying records {0} - {1} of {2} ',
emptyMsg:"No records to display ",
flex:1
}
],
columns:[
{
xtype:'gridcolumn',
dataIndex:'PartName',
name:'PartName',
text:'Part',
flex:1
},
{
xtype:'gridcolumn',
text:'PO ID',
dataIndex:'PoNumber',
name:'PoNumber',
width: 80,
align: 'center'
},
{
xtype:'gridcolumn',
text:'Material',
dataIndex:'Name',
name:'Name',
flex:1
},
{
xtype:'gridcolumn',
text:'Total',
dataIndex:'Total',
name:'Total',
width: 80,
align: 'center'
},
{
xtype:'gridcolumn',
text:'Size / Ref',
dataIndex:'SizeReference',
name:'SizeReference',
width: 80,
align: 'center'
},
{
xtype:'gridcolumn',
text:'Size L',
dataIndex:'SizeLength',
name:'SizeLength',
width: 80,
align: 'center'
},
{
xtype:'gridcolumn',
text:'Size W',
dataIndex:'SizeWidth',
name:'SizeWidth',
width: 80,
align: 'center'
},
{
xtype:'gridcolumn',
text:'Quantity',
dataIndex:'Quantity',
name:'Quantity',
width: 80,
align: 'center'
},
{
xtype:'gridcolumn',
text:'Meterage',
dataIndex:'Meterage',
name:'Meterage',
width: 80,
align: 'center'
}
],
initComponent:function () {
this.callParent();
}
});
我的模型。
Ext.define('Mis.model.MaterialPurchaseOrder', {
extend: 'Ext.data.Model',
idProperty: 'Id',
fields: [
{
mapping: 'Id',
name: 'Id'
},
{
mapping: 'Name',
name: 'Name'
},
{
mapping: 'SizeReference',
name: 'SizeReference'
},
{
mapping: 'SizeLength',
name: 'SizeLength'
},
{
mapping: 'SizeWidth',
name: 'SizeWidth'
},
{
mapping: 'Quantity',
name: 'Quantity'
},
{
mapping: 'Meterage',
name: 'Meterage'
},
{
mapping: 'PoNumber',
name: 'PoNumber'
},
{
mapping: 'PartId',
name: 'PartId'
},
{
mapping: 'PartName',
name: 'PartName'
},
{
mapping: 'Total',
name: 'Total'
},
{
mapping: 'MaterialType',
name: 'MaterialType'
},
{
mapping: 'MaterialTypeId',
name: 'MaterialTypeId'
}
],
proxy: {
type: 'ajax',
url: '',
api:
{
read: '/Material/ReadAssignedPurchaseOrder/',
update: '/Material/Update',
create: '/Material/Update',
destroy: '/Material/Remove'
},
reader: {
type: 'json',
root: 'Materials',
successProperty: 'Success',
totalProperty: 'Total'
},
writer:{
type:'json',
allowSingle:true
}
}
});
店铺
Ext.define('Mis.store.MaterialPurchaseOrders', {
extend: 'Ext.data.Store',
requires: 'Mis.model.MaterialPurchaseOrder',
model: 'Mis.model.MaterialPurchaseOrder',
pageSize: 4
});