下面是EasyUI 官网上处理datagrid border的demo:

主要是这句:

$('#dg').datagrid('getPanel').removeClass('lines-both lines-no lines-right lines-bottom').addClass(cls);
    <!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Row Border 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.min.js"></script>
<script type="text/javascript" src="../../jquery.easyui.min.js"></script>
</head>
<body>
<h2>Row Border in DataGrid</h2>
<p>This sample shows how to change the row border style of datagrid.</p>
<div style="margin:20px 0;">
<span>Border:</span>
<select onchange="changeBorder(this.value)">
<option value="lines-both">Both</option>
<option value="lines-no">No Border</option>
<option value="lines-right">Right Border</option>
<option value="lines-bottom">Bottom Border</option>
</select>
<span>Striped:</span>
<input type="checkbox" onclick="$('#dg').datagrid({striped:$(this).is(':checked')})">
</div>
<table id="dg" class="easyui-datagrid" title="Row Border in DataGrid" style="width:700px;height:250px"
data-options="singleSelect:true,fitColumns:true,url:'datagrid_data1.json',method:'get'">
<thead>
<tr>
<th data-options="field:'itemid',width:80">Item ID</th>
<th data-options="field:'productid',width:100">Product</th>
<th data-options="field:'listprice',width:80,align:'right'">List Price</th>
<th data-options="field:'unitcost',width:80,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>
<script type="text/javascript">
function changeBorder(cls){
$('#dg').datagrid('getPanel').removeClass('lines-both lines-no lines-right lines-bottom').addClass(cls);
}
</script>
<style type="text/css">
.lines-both .datagrid-body td{
}
.lines-no .datagrid-body td{
border-right:1px dotted transparent;
border-bottom:1px dotted transparent;
}
.lines-right .datagrid-body td{
border-bottom:1px dotted transparent;
}
.lines-bottom .datagrid-body td{
border-right:1px dotted transparent;
}
</style>
</body>
</html>

当然还可以直接在datagrid定义时采用下面的方式(styler部分):

grid = $('#grid').datagrid({
title : '',
url : '',
striped : true,
rownumbers : true,
pagination : false,
singleSelect : true,
idField : 'id',
sortOrder : 'desc',
columns : [ [ {
width : '100',
title : '地址',
field : 'address',
sortable : true,
styler : function(value, row, index) {
return 'border:0;';
}
}]]
});

最新文章

  1. POJ1190生日蛋糕[DFS 剪枝]
  2. visio任意角度精确旋转图形
  3. Jenkins Slave 通过JNLP 的方式 访问Master IP 总是127.0.0.1
  4. 记录Python学习中的几个小问题
  5. Android视频播放之VideoView
  6. ThoughtWorks 2016年第1期DNA活动总结
  7. 【转】怎样提高VR渲染速度
  8. JSP Workshop
  9. 传智播客C语言视频第二季(第一季基础上增加诸多C语言案例讲解,有效下载期为10.5-10.10关闭)
  10. Codeforces 435B. Pasha Maximizes
  11. Android OpenGL ES(七)基本几何图形定义 .
  12. Java中处理二进制移位
  13. JavaSE(一) IO类层次关系和各种IO流的用法总结
  14. javac编译乱码
  15. 2018 Multi-University Training Contest 3 杭电多校第三场
  16. ASP.NET MVC+HighCharts开发统计图表
  17. Using jconsole to connect to JMX on AS7
  18. SQL Server跨服务器建立视图
  19. unigui在阿里云服务器上部署
  20. 安装windows 2003iso 步骤

热门文章

  1. Spider爬虫-get、post请求
  2. Python socket粘包问题(初级解决办法)
  3. 九度oj 题目1411:转圈
  4. Echarts学习总结(一)-----柱状图
  5. java面试题之死锁产生的条件,以及如何避免死锁,银行家算法,产生死锁后如何解决(阿里面试题)
  6. java任务调度Timer简单例子
  7. hdu 3320 计算几何(三维图形几何变换)
  8. 【Windows API】OpenClipboard --- 剪切板(转)
  9. wpf LookUpEdit PopupContentTemplate
  10. Servlet 2.4 规范之第四篇:Servlet上下文