easyui datagrid 右冻结



 easyui  官网有一个例子是 左冻结的

 

<!DOCTYPE html>
<html>
<head>
 <meta charset="UTF-8">
 <title>Frozen Columns in DataGrid - jQuery EasyUI Demo</title>
 <link rel="stylesheet" type="text/css" href="../../themes/default/easyui.css">
 <link rel="stylesheet" type="text/css" href="../../themes/icon.css">
 <link rel="stylesheet" type="text/css" href="../demo.css">
 <script type="text/javascript" src="../../jquery-1.8.0.min.js"></script>
 <script type="text/javascript" src="../../jquery.easyui.min.js"></script>
</head>
<body>
 <h2>Frozen Columns in DataGrid</h2>
 <div class="demo-info">
  <div class="demo-tip icon-tip"></div>
  <div>You can freeze some columns that can't scroll out of view.</div>
 </div>
 <div style="margin:10px 0;"></div>
 <table class="easyui-datagrid" title="Frozen Columns in DataGrid" style="width:700px;height:250px"
   data-options="rownumbers:true,singleSelect:true,url:'../datagrid/datagrid_data1.json'">
  <thead data-options="frozen:true">
   <tr>
    <th data-options="field:'itemid',width:100">Item ID</th>
    <th data-options="field:'productid',width:120">Product</th>
   </tr>
  </thead>
  <thead>
   <tr>
    <th data-options="field:'listprice',width:90,align:'right'">List Price</th>
    <th data-options="field:'unitcost',width:90,align:'right'">Unit Cost</th>
    <th data-options="field:'attr1',width:250">Attribute</th>
    <th data-options="field:'status',width:60,align:'center'">Status</th>
   </tr>
  </thead>
 </table>

</body>
</html>

 



 

 

可能部分 开发人员在实际需求中要求 右列冻结 左边 可以有拖动框

 

官网有一个 RTL操作 但是 没有提供 代码示例 ,经过直接查看网页源代码 稍微研究了下

发现只要引入   <link rel="stylesheet" type="text/css" href="easyui-rtl.css"> 
 <script type="text/javascript" src="easyui-rtl.js"></script>这两个文件就好了

 

这时候 页面 单冻结效果就相反了 ,但是有一个问题 表头会消失

后来通过火狐调试发现 得改下 easyui-rtl.css文件里的 .datagrid-header-inner的属性

 

改成这样就好了

/**原先是这个 如果这样的话会导致 表头显示不了
.datagrid-header-inner{
 float:right;
}
**/
.datagrid-header-inner{
 float:left;
}

 

 

现在效果就变成了

 

  • 大小: 73.8 KB
  • 大小: 74.4 KB
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值