97a87ac523fcd415ed7b55a6e186f1ae4b5ffd33.svn-base 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="UTF-8">
  5. <title>Row Border in DataGrid - jQuery EasyUI Demo</title>
  6. <link rel="stylesheet" type="text/css" href="../../themes/default/easyui.css">
  7. <link rel="stylesheet" type="text/css" href="../../themes/icon.css">
  8. <link rel="stylesheet" type="text/css" href="../demo.css">
  9. <script type="text/javascript" src="../../jquery.min.js"></script>
  10. <script type="text/javascript" src="../../jquery.easyui.min.js"></script>
  11. </head>
  12. <body>
  13. <h2>Row Border in DataGrid</h2>
  14. <p>This sample shows how to change the row border style of datagrid.</p>
  15. <div style="margin:20px 0;">
  16. <span>Border:</span>
  17. <select onchange="changeBorder(this.value)">
  18. <option value="lines-both">Both</option>
  19. <option value="lines-no">No Border</option>
  20. <option value="lines-right">Right Border</option>
  21. <option value="lines-bottom">Bottom Border</option>
  22. </select>
  23. <span>Striped:</span>
  24. <input type="checkbox" onclick="$('#dg').datagrid({striped:$(this).is(':checked')})">
  25. </div>
  26. <table id="dg" class="easyui-datagrid" title="Row Border in DataGrid" style="width:700px;height:250px"
  27. data-options="singleSelect:true,fitColumns:true,url:'datagrid_data1.json',method:'get'">
  28. <thead>
  29. <tr>
  30. <th data-options="field:'itemid',width:80">Item ID</th>
  31. <th data-options="field:'productid',width:100">Product</th>
  32. <th data-options="field:'listprice',width:80,align:'right'">List Price</th>
  33. <th data-options="field:'unitcost',width:80,align:'right'">Unit Cost</th>
  34. <th data-options="field:'attr1',width:250">Attribute</th>
  35. <th data-options="field:'status',width:60,align:'center'">Status</th>
  36. </tr>
  37. </thead>
  38. </table>
  39. <script type="text/javascript">
  40. function changeBorder(cls){
  41. $('#dg').datagrid('getPanel').removeClass('lines-both lines-no lines-right lines-bottom').addClass(cls);
  42. }
  43. </script>
  44. <style type="text/css">
  45. .lines-both .datagrid-body td{
  46. }
  47. .lines-no .datagrid-body td{
  48. border-right:1px dotted transparent;
  49. border-bottom:1px dotted transparent;
  50. }
  51. .lines-right .datagrid-body td{
  52. border-bottom:1px dotted transparent;
  53. }
  54. .lines-bottom .datagrid-body td{
  55. border-right:1px dotted transparent;
  56. }
  57. </style>
  58. </body>
  59. </html>