1. 程式人生 > >easyui 表頭顏色 、列內容顏色 、多級表頭

easyui 表頭顏色 、列內容顏色 、多級表頭

<%@ page contentType="text/html;charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/common/tag.inc.jsp"%>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>

<!-- 表頭顏色 -->
<style> .datagrid-header-row td{background-color:#36C0DA;color:#fff} </style> <script> var stepList="";//工序集合 $(function () { searchdata(); }); //改變一列中 內容的顏色 function stylerone(value, row, index) { return 'background-color:#C0D9D9;color:black'; } function
searchdata(){
$("#KPIProduction").datagrid({ url: "<c:url value='/qm/ProductionReport.sp?method=KPIProductionReport'/>", remoteSort:true, columns:[ [ {title: '工單資訊統計',colspan:4}, {title:'物料使用統計',colspan:4
}, {title:'時間統計',colspan:4}, {title:'效率資訊統計',colspan:1} ], [ { field: 'planWorkNumber',title:'計劃工單數(個)',width:125, align: 'center',styler:stylerone }, { field: 'trueFinish',title:'工單實際完成數(個)',width:125,aligb:'center'}, { field: 'workCompletion',title:'工單完成率(%)',width:150, align: 'center'}, { field: 'actualProduction',title:'實際產量(KG)',width:145, align: 'center'}, { field: 'feedNumber',title:'生產投料量(KG)',width:145, align: 'center'}, { field: 'wasteNumber',title:'廢品量(KG)',width:145, align: 'center'}, { field: 'yield',title:'成品率(%)',width:145, align: 'center'}, { field: 'cleanNumber',title:'清機投料量(KG)',width:145, align: 'center'}, { field: 'productionTime',title:'生產時間(H)',width:145, align: 'center'}, { field: 'cleanTime',title:'清機時間(H)',width:100, align: 'center'}, { field: 'downTime',title:'裝置異常停機時間(H)',width:140, align: 'center'}, { field: 'MachineOK',title:'裝置完好率(%)',width:100, align: 'center'}, { field: 'hourOutPut',title:'機臺小時產出',width:100, align: 'center'} ] ], queryParams:{ StratDay:$("#txtqueryStratDay").datebox('getValue'), EndDay:$("#txtqueryEndDay").datebox('getValue'), machineNumber:$("#txtmachineNumber").textbox('getValue'), stepNo:$("#txtstepNo","#query").combobox('getValue'), eqLevel:$("#txteqLevel").textbox('getValue') }, }); }
</script> </head> <body class="main_body" > <title>裝置執行情況統計</title> <div class="src_area" id="query"> <table> <tr> <td><b>日期段查詢</b></td> <td><input id="txtqueryStratDay" name="txtqueryStratDay" class="easyui-datebox" style="width: 180px; height: 30px;" data-options="buttons:calendarClearButton,editable:false"></td> <td><input id="txtqueryEndDay" name="txtqueryEndDay" class="easyui-datebox" style="width: 180px; height: 30px;" data-options="buttons:calendarClearButton,editable:false"></td> <td><b>裝置編號</b></td> <td> <input id="txtmachineNumber" name="txtmachineNumber" class="easyui-textbox" style="width: 120px; height: 30px;"/> </td> <td><b>工序</b></td> <td> <input class="easyui-combobox" id="txtstepNo" name="txtstepNo" style="width: 130px; height: 30px;"/> </td> <td><b>裝置等級</b></td> <td> <select class="easyui-combobox" id="txteqLevel" name="txteqLevel" style="width: 130px; height: 30px;"> <option value="重要裝置">重要裝置</option> <option value="">所有裝置</option> <option value="一般裝置">一般裝置</option> </select> </td> <td> <a href="#" class="easyui-linkbutton normal_btn" data-options="iconCls:'icon-search'" onclick="searchdata()">查詢</a> </td> </tr> </table> </div> <table id="KPIProduction" class="easyui-datagrid" style="width: 100%;"> </body> </html>

這裡寫圖片描述