zoukankan      html  css  js  c++  java
  • Ext Grid表格的自动宽度及高度的实现

    希望Ext的表格能自适应外层的div大小,但Ext的Grid构造函数的width、height项不支持100%的设置方式,所以改用以下方式初始化Grid: 

    Ext.get("content").getWidth(), 
    height: Ext.get("content").getHeight(),
     

    <div id="content"> 
        <div id="grid-example"></div> 
    <div> 

    #content { 
    100%; 
    height: 100%; 


    完整js代码: 

    // create the Grid 
        var grid = new Ext.grid.GridPanel({ 
            store: store, 
            columns: [ 
                {id:'id',header: "序号", 50, sortable: true, renderer: keyChange, dataIndex: 'id'}, 
                {header: "数据表表名", 100, sortable: true, renderer: hrefChange, dataIndex: 'tableAlias'}, 
                {header: "物理表名", 100, sortable: true, dataIndex: 'tableName'}, 
                {header: "类型", 75, sortable: true, dataIndex: 'type'} 
            ], 
            stripeRows: true, 
            Ext.get("content").getWidth(), 
            height: Ext.get("content").getHeight(), 
    addClass:"grid", 
    tbar: [{ 
                text: '新增模版', 
                handler : function(){ 
    window.location.href = 'templateDefineList4.html'; 
                } 
                },{ 
                text: '删除模版', 
                handler : function(){ 

                } 
            }], 
            bbar: new Ext.PagingToolbar({ 
                pageSize: 15, 
                store: store, 
                displayInfo: true, 
                displayMsg: '当前显示记录 {0} - {1} 总条数 {2}', 
                emptyMsg: '无记录' 
            }) 
        });

  • 相关阅读:
    正则去掉 html标签
    app内嵌 h5页面 再滑动的时候 触发击穿底下的一些touchstart事件
    设置按钮不能连续点击并触发点击事件
    使用NPOI导入导出标准Excel
    ASP.NET导出word实例
    常用SQL语句大全总结
    判断以及防止SQL注入
    javascript 正则表达式总结
    前端页面优化技巧
    自我介绍
  • 原文地址:https://www.cnblogs.com/zhaoxd/p/3047596.html
Copyright © 2011-2022 走看看