7ece3c9ae889b721d73542bf4d576fc9a0001b53.svn-base 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="UTF-8">
  5. <title>DataGrid Row Style - 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>DataGrid Row Style</h2>
  14. <p>The rows which listprice value is less than 30 are highlighted.</p>
  15. <div style="margin:20px 0;"></div>
  16. <table class="easyui-datagrid" title="DataGrid Row Style" style="width:700px;height:250px"
  17. data-options="
  18. singleSelect: true,
  19. iconCls: 'icon-save',
  20. url: 'datagrid_data1.json',
  21. method: 'get',
  22. rowStyler: function(index,row){
  23. if (row.listprice < 30){
  24. return 'background-color:#6293BB;color:#fff;font-weight:bold;';
  25. }
  26. }
  27. ">
  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. </body>
  40. </html>