1.结论:按正常jqGid获取,在中间加入以下代码,即将小计行当成改变为普能行,以便能让'getRowData'方法获取到,第三点会进行原码分析

 //get all page grid data,including group count row
getJQAllData:function (jqGridId) {
var o = $("#"+jqGridId);
//get current page data $("#jqGridList").jqGrid('getRowData');
var rows=[];
rows= o.jqGrid('getRowData');
var rowNum = o.jqGrid('getGridParam', 'rowNum'); //get the record amount of current page data
var total = o.jqGrid('getGridParam', 'records'); //get the total records of all page
//reload the all data with no spliting of page,then can get all real data by invoking the function getRowData
o.jqGrid('setGridParam', { rowNum: total }).trigger('reloadGrid'); //here modify temporaily the attributes of "the group count row" ,so that can get the rows by invoking the function getRowData
//will restore after below reloadGrid is invoked
//below three row codes can be executed lonely in IE console
//if want to understand more please refer to the definition of function getRowData in js/jgGrid/jquery.jqGrid.src.js
$('tr[id^="jqGridListghead"]').addClass("jqgrow");//add the class to set it as normal row
$('tr[id^="jqGridListghead"] td').attr("role","gridcell");//add the attributes to set it as normal row
$('tr[id^="jqGridListghead"] td span').remove();//remove unnecessary <span> in the first <td> of the "the group count row",otherwise the got value from <td> will include excessive "<span....>"
rows = o.jqGrid('getRowData'); //get all grid data,and return {} if emtpy
o.jqGrid('setGridParam', { rowNum: rowNum }).trigger('reloadGrid'); //reset the original show
console.log("getJQAllData==>");
console.log(rows);
return (rows instanceof Array)?rows:[];
}

2.获取小计行

3.原码分析:在jquery.jqGrid.src.js第3103行找到方法定义,发现对标题进行了过滤,只需要对相应元素增加属性即可。

getRowData : function( rowid ) {
var res = {}, resall, getall=false, len, j=0;
this.each(function(){
var $t = this,nm,ind;
if(rowid === undefined) {
getall = true;
resall = [];
len = $t.rows.length;
} else {
ind = $($t).jqGrid('getGridRowById', rowid);
if(!ind) { return res; }
len = 2;
}
while(j<len){
if(getall) { ind = $t.rows[j]; }
if( $(ind).hasClass('jqgrow') ) {
$('td[role="gridcell"]',ind).each( function(i) {
nm = $t.p.colModel[i].name;
if ( nm !== 'cb' && nm !== 'subgrid' && nm !== 'rn') {
if($t.p.treeGrid===true && nm === $t.p.ExpandColumn) {
res[nm] = $.jgrid.htmlDecode($("span:first",this).html());
} else {
try {
res[nm] = $.unformat.call($t,this,{rowId:ind.id, colModel:$t.p.colModel[i]},i);
} catch (e){
res[nm] = $.jgrid.htmlDecode($(this).html());
}
}
}
});
if(getall) { resall.push(res); res={}; }
}
j++;
}
});
return resall || res;
}

jqGrid pivot获取所有行包括小计数据及原码分析的更多相关文章

  1. Spring IOC 容器源码分析 - 获取单例 bean

    1. 简介 为了写 Spring IOC 容器源码分析系列的文章,我特地写了一篇 Spring IOC 容器的导读文章.在导读一文中,我介绍了 Spring 的一些特性以及阅读 Spring 源码的一 ...

  2. java使用websocket,并且获取HttpSession,源码分析

    转载请在页首注明作者与出处 http://www.cnblogs.com/zhuxiaojie/p/6238826.html 一:本文使用范围 此文不仅仅局限于spring boot,普通的sprin ...

  3. jqgrid 获取所有行数据

    如何获取jqgrid所有数据? 通过 getRowData() 方法获得当前行数据 //获取所有行数据,是一个json对象集合 var rowArr= $("#jqGrid").g ...

  4. JS获取网页属性包括宽、高等

    JS获取网页属性包括宽.高等. function getInfo()  { // www.jbxue.com var s = "";  s += " 网页可见区域宽:&q ...

  5. inux关于readlink函数获取运行路径的小程序

    inux关于readlink函数获取运行路径的小程序   相关函数: stat, lstat, symlink 表头文件: #include <unistd.h> 定义函数:int  re ...

  6. 微信小程序开发——获取小程序带参二维码全流程

    前言: 想要获取微信小程序带参数二维码,如这种: 官方文档只说了获取小程序码和二维码的三种接口及调用(参考链接:https://developers.weixin.qq.com/miniprogram ...

  7. python excel操作 练习-#操作单列 #操作A到C列 #操作1到3行 #指定一个范围遍历所有行和列 #获取所有行 #获取所有列

    ##操作单列#操作A到C列#操作1到3行#指定一个范围遍历所有行和列#获取所有行#获取所有列 #coding=utf-8 from openpyxl import Workbook wb=Workbo ...

  8. 通过kfed自动获取磁盘信息的小脚本

    通过kfed自动获取磁盘信息的小脚本 编译KFED [oracle@rac lib]$cd $ORACLE_HOME/rdbms/lib [oracle@rac lib]$ pwd /u01/app/ ...

  9. 获取不同机型微信小程序状态栏+导航栏高度

    获取不同机型微信小程序状态栏+导航栏高度 一. 前言 很多时候我们开发微信小程序,都需要先知道状态栏和导航栏的高度,才能去做其他功能 二. 获取微信小程序状态栏高度 用wx.getSystemInfo ...

随机推荐

  1. Java NIO系列教程(十一) Pipe

    Java NIO 管道是2个线程之间的单向数据连接.Pipe有一个source通道和一个sink通道.数据会被写到sink通道,从source通道读取. 这里是Pipe原理的图示: 创建管道 通过Pi ...

  2. centos7.4安装过程

    开启CPU虚拟化 按到install CentOS7 按下tab 输入net.ifnames=0 biosdevname=0 先来一段文档v1 ============================ ...

  3. C语言强化——数组

    打印九九乘法表 #include<stdio.h> int main() { int num = 1; for (int i = 1;i <= 9;++i) { for (int j ...

  4. ROS-MikroTik-RouterOS-培训认证各种证书

    官方原文: https://mikrotik.com/training/about MikroTik certified training programs MTCNA - MikroTik Cert ...

  5. [UE4]国际化,中英文切换

    只有“Text”数据类型才支持国际化 必须以独立游戏窗口运行,语音切换才会起作用.

  6. 2018年1月 attribute VS prop 动画渲染

    attribute和prop和UI存在单向/双向绑定关系,参考 https://m.aliyun.com/yunqi/articles/31499 渲染流程 重绘和重排 ? requestAnimat ...

  7. Spring IoC中各个注解的理解和使用

    一.把在Spring的xml文件中配置bean改为Spring的注解来配置bean 传统的Spring做法是使用.xml文件来对bean进行注入或者是配置aop.事物,这么做有两个缺点:1.如果所有的 ...

  8. 把Excel选手名单信息导入到评委计分软件Access数据库的步骤

    第一步:用Excel制作选手名单 根据比赛要求,制作选手Excel名单信息,前4列要符合要求 A列:比赛顺序,整数数值类型.所以A列数值选中后,右击设置单元格格式 数字/数值/小数位数为0(见下图). ...

  9. MapReduce Demo

    功能:统计公司员工一个月内手机上网上行流量.下行流量及总流量. 测试数据如下: 13612345678     6000    1000 13612345678     2000    3000 13 ...

  10. css实战——第一天

    1.  开发前的准备 1.1配置开发环境   sublime  webstorm  vscode  Hbuilder  atom 1.2建立项目文件夹 主页或是首页    index.html   d ...