参考: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 合并表头的更多相关文章

  1. jqGrid合并表头

    jqGrid是一款常用的制表软件,最近开发刚好用到.记录一下常用功能留着以后查找顺便发扬一下开源精神. 二级表头是一种经常会碰到的需求,很多时候为了方便查找需要在原有的表头上再加一层,区分表格不同列的 ...

  2. asp.net GridView多行表头的实现,合并表头

    protected void GridView1_RowCreated(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == Da ...

  3. jqGrid合并单元格

    两个参数 /**合并单元格:合并指定 gridName表格的NoName 列,合并的标准是参考CellName+CellNameTwo列内单元格的值. * gridName :表格名称 * NoNam ...

  4. jqGrid实现表头自动换行

    当jqGrid表头内容过多无法全部展示时,添加以下css实现表头自动换行. <style type="text/css"> /* jqgrid 表头自动换行 */ th ...

  5. GridView合并表头多重表头

    后台代码: using System; using System.Data; using System.Configuration; using System.Web; using System.We ...

  6. NPOI导出Excel合并表头写入公式

    protected void Btn1_Click(object sender, EventArgs e) { //建立空白工作簿 IWorkbook workbook = new HSSFWorkb ...

  7. GridView合并表头、多重表头(转)

    protected void GridView1_RowCreated(object sender, GridViewRowEventArgs e) { switch (e.Row.RowType) ...

  8. handsontable合并表头

    想在页面中做类似excel的操作,发现handsontable符合要求. 然后发现这个文章 http://blog.csdn.net/wynan830/article/details/9054195 ...

  9. DataGrid Column Group (合并表头)

    <thead> <tr> <th colspan=">swjg</th> <th colspan=">swbm</ ...

随机推荐

  1. 跨域-CORS

    跨域:是浏览器为了安全而做出的限制策略 浏览器请求必须遵循同源策略:同域名,同端口,同协议 cors跨域- 服务器端设置,前端直接调用 说明:后台允许前端某个站点进行访问 后台设置 Access-Co ...

  2. leetCode练题——27. Remove Element

    1.题目 27. Remove Element——Easy Given an array nums and a value val, remove all instances of that valu ...

  3. mybatis Plus 多表联合查询

    //实体类package com.sk.skkill.entity; import com.baomidou.mybatisplus.annotation.TableField;import com. ...

  4. ES2.3.5版本的数据类型

    1,最近使用了2.3.5版本的ES,发现在创建索引的时候出了以下错误. (1)例: POST 192.168.11.166:9200/article3/article/_mapping { " ...

  5. Python学习第二十二课——Mysql 表记录的一些基本操作 (增删改)

    记录基本操作: 增:(insert into) 基本语法: insert into 表名(字段) values(对应字段的值): 例子1: insert into employee(id,name,a ...

  6. JSON 解析中遇到的坑😭

    最近做加解密遇到一个很“奇葩的问题”,解析服务端加密后的字符串 序列化 时一直报错 "json解析失败:Error Domain=NSCocoaErrorDomain Code=3840 & ...

  7. Linux服务器yum安装mysql

    阿里云Linux 服务器安装mysql 可以用rpm 和yum 方式安装,我这次安装是采用yum方式安装 请直接复制以下链接,看安装步骤 https://www.cnblogs.com/nzplear ...

  8. [原]Greenplum failed segment的恢复方法

    当在使用greenplum过程中有不当的操作时,可能会出现segment节点宕掉的情况(比如在greenplum运行的过程中停掉其中几台segment节点的服务器),通过下面的方法可以恢复segmen ...

  9. Red Black Tree(红黑树)

    (修改于 2018-05-06 15:53:22 还差删除维护操作.层序遍历没完成.维护操作没完成不想写层序遍历怎么办...) 今天下午完成了红黑树的插入的维护操作,但删除的维护操作还没有解决,删除的 ...

  10. pagehelper 分页不生效,总页数总是1解决方案

    问题: 后台查询后的数据只有1页,已经设置了PageHelper也没用 PageHelper.startPage(pageNum,pageSize); ModelAndView mv=new Mode ...