zoukankan      html  css  js  c++  java
  • EasyUI 冻结列

    一、如果是js绘制的,设置frozenColumn属性就可以,frozenColumn 属性和 columns 属性都是设置列,frozenColumn是设置冻结列

    $('#tt').datagrid({
            title:'Frozen Columns',
            iconCls:'icon-save',
            500,
            height:250,
            url:'data/datagrid_data.json',
            frozenColumns:[[
                {field:'itemid',title:'Item ID',80},
                {field:'productid',title:'Product ID',80},
            ]],
            columns:[[
                {field:'listprice',title:'List Price',80,align:'right'},
                {field:'unitcost',title:'Unit Cost',80,align:'right'},
                {field:'attr1',title:'Attribute',100},
                {field:'status',title:'Status',60}
            ]]
        });

    二、如果是html绘制的,加一个frozen="true"属性就可以了

    <thead frozen="true">
                <tr>
                    <th field="itemid" width="80">Item ID</th>
                    <th field="productid" width="80">Product ID</th>
                </tr>
    </thead>

    实现效果如下:拖动的时候冻结的列不动,如果非冻结列字段比较多,会自动添加滚动条在非冻结列上

  • 相关阅读:
    web http协议
    swoole udp
    swoole线程和进程
    SVN中trunk,branches,tags用法详解
    mysql外键使用和事物使用
    xml
    dedecms开启报错
    Django CBV方法装饰器
    Django Cookie和Session
    ORM基础5
  • 原文地址:https://www.cnblogs.com/zhangjd/p/5882048.html
Copyright © 2011-2022 走看看