我使用ExtJs 4.2网格和分页工具栏。分页工具栏只在Firefox中出错,但它在Chrome和IE中正确显示。
图片与帖子ExtJS paging toolbar malformed
中显示的图片相同我已经包含了文件
<link href="../../ext-4.2.0.663/resources/css/ext-all.css" rel="stylesheet" type="text/css" />
<script src="<%=ResolveUrl("~/ext-4.2.0.663/ext-all.js")%>" type="text/javascript"></script>
ExtJs代码块:
grid1 = new xg.GridPanel({
store: store,
// cm: cm1,
columns: [ <%= gridColumns %>],
loadMask: true,
layout: 'auto',
width: getGridWidth(),
renderTo: 'bdy',
viewConfig: {
//forceFit: false
onLoad: Ext.emptyFn,
preserveScrollOnRefresh: true,
scroll: 'both'
} ,
bbar: new Ext.PagingToolbar({
// pageSize: 10,//<<---does not required in ExtJs 4.2 as this property is no more found in Ext.PagingToolbar
id: "gridPaging",
store: (store),
displayInfo: true,
displayMsg: 'Displaying records {0} - {1} of {2}',
emptyMsg: "No records to display"
})
});
答案 0 :(得分:0)
我在firefox中运行了示例代码,它完全正常工作。为什么你提供商店作为(商店),尝试修复商店然后它的工作。(顺便说一句,我在Extjs 4.2.1测试)
以下是示例代码。
var store = Ext.create('Ext.data.Store', {
storeId:'simpsonsStore',
fields:['name', 'email', 'phone'],
data:{'items':[
{ 'name': 'Lisa', "email":"lisa@simpsons.com", "phone":"555-111-1224" },
{ 'name': 'Bart', "email":"bart@simpsons.com", "phone":"555-222-1234" },
{ 'name': 'Homer', "email":"home@simpsons.com", "phone":"555-222-1244" },
{ 'name': 'Marge', "email":"marge@simpsons.com", "phone":"555-222-1254" }
]},
proxy: {
type: 'memory',
reader: {
type: 'json',
root: 'items'
}
}
});
Ext.create('Ext.grid.Panel', {
title: 'Simpsons',
store: Ext.data.StoreManager.lookup('simpsonsStore'),
columns: [
{ text: 'Name', dataIndex: 'name' },
{ text: 'Email', dataIndex: 'email', flex: 1 },
{ text: 'Phone', dataIndex: 'phone' }
],
height: 200,
width: 400,
bbar: new Ext.PagingToolbar({
id: "gridPaging",
store: store,
displayInfo: true,
displayMsg: 'Displaying records {0} - {1} of {2}',
emptyMsg: "No records to"
}),
renderTo: Ext.getBody()
});