简体   繁体   English

EXTJS 4.2分页工具栏格式问题

[英]EXTJS 4.2 Paging toolbar formatissue

i have used ExtJs 4.2 grid with paging toolbar.Paging toolbar is malformed only in Firefox,however it is displayed properly in Chrome and IE. 我已经使用了带有分页工具栏的ExtJs 4.2网格。分页工具栏仅在Firefox中格式错误,但是在Chrome和IE中可以正确显示。

The image is same as displayed in post ExtJS paging toolbar malformed 该图像与在ExtJS的分页工具栏中显示的格式错误

I have included the files 我已经包含了文件

<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 code block: 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"
                    })

                });

I have run the sample code in firefox and it is perfectly working fine. 我已经在firefox中运行了示例代码,它运行正常。 Why are you providing store as (store), try to fix the store then it works.(BTW I tested it in Extjs 4.2.1) 为什么要以(store)的形式提供store,请尝试修复该store然后它可以工作。(顺便说一句,我在Extjs 4.2.1中对其进行了测试)

在此处输入图片说明

Here is the sample code. 这是示例代码。

  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()
});

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM