Extjs 3.4 - GridPanel 配置

  Extjs gridpanel  配置大概有几个比较重要的 
   
    1.Store 数据源 

    2.Columns或cm 定义列渲染 , header 列名 dataIndex 数据索引 render 列渲染方法

    3.ViewConfig.forceFit为true + 父窗体layout为 fit  时 可让girdpanel 自适应宽高   

    eg:

   var gpanel = new Ext.Panel({
            title: "订单查询",
            layout: "fit",
            items: [{
                xtype: "grid",
                sm: new Ext.grid.RowSelectionModel({ singleSelect: false }),
                columnLines: true,
                viewConfig: {
                    forceFit: true, 
                    emptyText: '系统中还没有任务'
                },
                bbar: new Ext.PagingToolbar({}),          
                store: new Ext.data.JsonStore({
                    url: "/admin/Order",
                    autoLoad: true,
                    root:"data",
                    fields: ['o_OrderNo', 'o_TicketCount', 'o_PayAmount', 'o_CustomerName', 'o_IdCard', 'o_Telephone', 'o_SaleTime', 'o_Status']

                }),         
                columns: [  { header: "订单号", dataIndex: "o_OrderNo",
                                      width:160, sortable: true },
                            { header: "票数", dataIndex: "o_TicketCount",
                                       width: 160, sortable: true },
                            { header: "金额", dataIndex: "o_PayAmount", 
                                       width: 160, sortable: true },
                            { header: "用户", dataIndex: "o_CustomerName",
                                       width: 160, sortable: true },
                            { header: "身份证", dataIndex: "o_IdCard", 
                                       width: 160, sortable: true },
                            { header: "手机", dataIndex: "o_Telephone",
                                       width: 160, sortable: true },
                            { header: "售票时间", dataIndex: "o_SaleTime", 
                                       width: 160, sortable: true },
                            { header: "状态", dataIndex: "o_Status",
                                       width: 160, sortable: true },
                ]

            }]

        });


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值