码迷,mamicode.com
首页 > 其他好文 > 详细

jqgrid 合并表头

时间:2018-07-15 12:29:02      阅读:320      评论:0      收藏:0      [点我收藏+]

标签:表头   enter   dex   www.   itop   com   jquer   wiki   mod   

参考:http://www.trirand.com/jqgridwiki/doku.php?id=wiki:groupingheadar

jQuery("#表格id").jqGrid({
  ...
  colNames: [‘Date‘, ‘Client‘, ‘Amount‘, ‘Tax‘, ‘Total‘, ‘Closed‘, ‘Shipped via‘, ‘Notes‘],
  colModel: [
    {name: ‘invdate‘, index: ‘invdate‘, width: 80, align: ‘center‘, sorttype: ‘date‘,formatter: ‘date‘, formatoptions: {newformat: ‘d-M-Y‘}, datefmt: ‘d-M-Y‘},
    {name: ‘name‘, index: ‘name‘, width: 70 },
    {name: ‘amount‘, index: ‘amount‘, width: 75, formatter: ‘number‘, sorttype: ‘number‘, align: ‘right‘},
    {name: ‘tax‘, index: ‘tax‘, width: 75, formatter: ‘number‘, sorttype: ‘number‘, align: ‘right‘},
    {name: ‘total‘, index: ‘total‘, width: 75, formatter: ‘number‘, sorttype: ‘number‘, align: ‘right‘},
    {name: ‘closed‘, index: ‘closed‘, width: 75, align: ‘center‘, formatter: ‘checkbox‘, edittype: ‘checkbox‘, editoptions: {value: ‘Yes:No‘, defaultValue: ‘Yes‘}},
    {name: ‘ship_via‘, index: ‘ship_via‘, width: 100, align: ‘center‘, formatter: ‘select‘, edittype: ‘select‘, editoptions: {value: ‘FE:FedEx;TN:TNT;IN:Intim‘, defaultValue: ‘Intime‘}},
    {name: ‘note‘, index: ‘note‘, width: 70, sortable: false}
],
  rowNum: 10,
  rowList: [5, 10, 20],
  ...
});


jQuery("#表格id").jqGrid(‘setGroupHeaders‘, {
   useColSpanStyle: false,
   groupHeaders:[
     {startColumnName: ‘开始的标题名称‘, numberOfColumns: 合并的表头数量, titleText: ‘<em>合并后的表头名称</em>‘},
     {startColumnName: ‘开始的标题名称‘, numberOfColumns: 合并的表头数量, titleText: ‘合并后的表头名称‘}
   ]
});

jqgrid 合并表头

标签:表头   enter   dex   www.   itop   com   jquer   wiki   mod   

原文地址:https://www.cnblogs.com/lvlin241/p/9313021.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!