先上效果图:
$(\'#rteLogGrid\').datagrid({url:\'<%=basePath %>/orgRteLog/list\',method:\'POST\',fitColumns:true,striped:true,columns: [[{ title: \'自提点编号\', field: \'orgId\', width: 90, align:\'center\',rowspan:2},{ title: \'自提点名称\', field: \'orgName\', width: 185, align:\'left\',rowspan:2},{ title: \"更新前\", colspan: 4,},{ title: \"更新后\", colspan: 4},{ title: \'更新人\', field: \'editor\', width: 110, align:\'center\',rowspan:2},{ title: \'更新时间\', field: \'editTime\', width: 140, align:\'center\',formatter:jsonTimeStamp,rowspan:2},],[{\"field\":\"serialNo\",\"title\":\"路序\",width: 80, align:\'center\',\"rowspan\":1},{\"field\":\"rteNo\",\"title\":\"线路名称\",width: 125, align:\'left\',\"rowspan\":1},{\"field\":\"driverName\",\"title\":\"司机姓名\",width: 90, align:\'center\',\"rowspan\":1},{\"field\":\"driverPhone\",\"title\":\"司机电话\",width: 100, align:\'center\',\"rowspan\":1},{\"field\":\"serialNo\",\"title\":\"路序\",width: 80, align:\'center\',\"rowspan\":1},{\"field\":\"rteNo\",\"title\":\"线路名称\",width: 125, align:\'left\',\"rowspan\":1},{\"field\":\"driverName\",\"title\":\"司机姓名\",width: 90, align:\'center\',\"rowspan\":1},{\"field\":\"driverPhone\",\"title\":\"司机电话\",width: 100, align:\'center\',\"rowspan\":1}]]});
关键代码:columns里面有几个 [] 就有几行表头。。剩下的自己品吧~