grid简单实现分页

本文档展示了如何使用ExtJS创建一个包含多种列类型的网格面板,并配置了数据存储及分页工具栏,实现了基本的数据展示功能。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

 var context_store = new Ext.data.Store({  
                url: 'context.jsp',  
                reader: new Ext.data.JsonReader({  
                    root: 'rows',  
                    totalProperty: 'results',  
                    id: 'contentPK' 
                },[  
                    'contentPK',  
                    'msgPK',  
                    'madePersonPK',   
                    'madePersonName',     
                    'madeDate',   
                    'subject',    
                    'content',    
                    'attachmentNo',   
                    'remoteAddr',     
                    'personNamesOfNeedReply',     
                    'personNamesOfNotReply' 
                ])  
            });   
              
              
            var context_grid_v = new Ext.grid.GridPanel({  
                title:'回复列表',  
                id : 'context-grid',  
                //xtype: 'grid',  
                frame: false,  
                //width:300,  
                store: context_store,  
                region: 'center',  
                columns: [  
                    {header: 'ContentPK', dataIndex: 'contentPK',sortable: true},  
                    {header: 'msgPK', dataIndex: 'msgPK',sortable: true},  
                    {header: '主题', dataIndex: 'subject',sortable: true},  
                    {header: '内容', dataIndex: 'content'},  
                    {header: '写信人', dataIndex: 'madePersonName'},  
                    {header: '写信日期',dataIndex: 'madeDate', sortable: true},  
                    {header: 'IP地址', dataIndex: 'remoteAddr'},  
                    {header: '收件人(要回)', dataIndex: 'personNamesOfNeedReply'},  
                    {header: '收件人', dataIndex: 'personNamesOfNotReply'}  
                ],  
                stripeRows: true,  
                sm: new Ext.grid.RowSelectionModel({  
                    singleSelect: true 
                }),  
                tbar:[' ', '写信日期:' 
                    , {  
                        xtype: 'datefield' 
                    }, ' ',  
                    '写信人:',  
                    {  
                        xtype:'textfield',  
                        width:70  
                    },' ',{  
                        xtype:'button',  
                        text:'查询' 
                }],  
                bbar: new Ext.PagingToolbar({  //分页工具 
                    pageSize: 20,  
                    store: context_store,  
                    displayInfo: true,  
                      
                })  
            });

 

 

引用于http://www.iteye.com/problems/49860中的代码对

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值