Forum
10:13
05/09/2013
Hi,
I am using jqgrid v 4.4.1 and Chrome v 29.
I set grouping attribute to true and the table does show properly in Chrome, it works fine in IE and Mozilla.
Looks like chrome does not do correct sorting.
Code –
<body>
<div id="content_id" style="width: 740px;" >
<table id="list48"></table>
</div>
<script type="text/javascript">
var totalRows = new Array();
var rowCount = 0;
$(document).ready(function(){
var gridVar = $("#list48");
var mydata = [
{MBR_RLTNSHP_CD:'18',majorDiagnosis:'Neurotic Disorders',inpatientFacility:'$0',outpatientFacility:'$17,111',professional:'$748,191',totalPaid:'$765,302',percentOfTotal:'33.1%',uniqueClaimants:'771',paidAmountPerClaimant:'$992.60',dummyCol:'',attr:{MBR_RLTNSHP_CD:{rowspan:'5'},dummyCol:{rowspan:'5'}}},
{MBR_RLTNSHP_CD:'18',majorDiagnosis:'Affective Psychoses',inpatientFacility:'$66,190',outpatientFacility:'$38,143',professional:'$448,981',totalPaid:'$553,314',percentOfTotal:'23.9%',uniqueClaimants:'438',paidAmountPerClaimant:'$1,263.27',dummyCol:'',attr:{MBR_RLTNSHP_CD:{display:'none'},dummyCol:{display:'none'}}},
{MBR_RLTNSHP_CD:'18',majorDiagnosis:'Adjustment Reaction',inpatientFacility:'$48,952',outpatientFacility:'$0',professional:'$442,806',totalPaid:'$491,757',percentOfTotal:'21.3%',uniqueClaimants:'500',paidAmountPerClaimant:'$983.51',dummyCol:'',attr:{MBR_RLTNSHP_CD:{display:'none'},dummyCol:{display:'none'}}},
{MBR_RLTNSHP_CD:'18',majorDiagnosis:'All Other Behavioral Health',inpatientFacility:'$112,787',outpatientFacility:'$89,952',professional:'$298,184',totalPaid:'$500,923',percentOfTotal:'21.7%',uniqueClaimants:'609',paidAmountPerClaimant:'$19,146.47',dummyCol:'',attr:{MBR_RLTNSHP_CD:{display:'none'},dummyCol:{display:'none'}}},
{MBR_RLTNSHP_CD:'18',majorDiagnosis:'Total Behavioral Health',inpatientFacility:'$227,929',outpatientFacility:'$145,206',professional:'$1,938,161',totalPaid:'$2,311,296',percentOfTotal:'100.0%',uniqueClaimants:'2,318',paidAmountPerClaimant:'$22,385.85',dummyCol:'',attr:{MBR_RLTNSHP_CD:{display:'none'},dummyCol:{display:'none'}}},
{MBR_RLTNSHP_CD:'01',majorDiagnosis:'Affective Psychoses',inpatientFacility:'$126,223',outpatientFacility:'$178,871',professional:'$378,749',totalPaid:'$683,843',percentOfTotal:'35.7%',uniqueClaimants:'370',paidAmountPerClaimant:'$1,848.22',dummyCol:'',attr:{MBR_RLTNSHP_CD:{rowspan:'3'},dummyCol:{rowspan:'3'}}},
{MBR_RLTNSHP_CD:'01',majorDiagnosis:'All Other Behavioral Health',inpatientFacility:'$125,409',outpatientFacility:'$222,431',professional:'$885,269',totalPaid:'$1,233,109',percentOfTotal:'64.3%',uniqueClaimants:'1,105',paidAmountPerClaimant:'$50,983.38',dummyCol:'',attr:{MBR_RLTNSHP_CD:{display:'none'},dummyCol:{display:'none'}}},
{MBR_RLTNSHP_CD:'01',majorDiagnosis:'Total Behavioral Health',inpatientFacility:'$251,632',outpatientFacility:'$401,302',professional:'$1,264,018',totalPaid:'$1,916,952',percentOfTotal:'100.0%',uniqueClaimants:'1,475',paidAmountPerClaimant:'$52,831.60',dummyCol:'',attr:{MBR_RLTNSHP_CD:{display:'none'},dummyCol:{display:'none'}}},
{MBR_RLTNSHP_CD:'19',majorDiagnosis:'Psychoses of Childhood',inpatientFacility:'$0',outpatientFacility:'$7,791',professional:'$604,277',totalPaid:'$612,068',percentOfTotal:'31.1%',uniqueClaimants:'115',paidAmountPerClaimant:'$5,322.33',dummyCol:'',attr:{MBR_RLTNSHP_CD:{rowspan:'3'},dummyCol:{rowspan:'3'}}},
{MBR_RLTNSHP_CD:'19',majorDiagnosis:'All Other Behavioral Health',inpatientFacility:'$231,344',outpatientFacility:'$273,416',professional:'$853,886',totalPaid:'$1,358,646',percentOfTotal:'68.9%',uniqueClaimants:'1,050',paidAmountPerClaimant:'$35,889.24',dummyCol:'',attr:{MBR_RLTNSHP_CD:{display:'none'},dummyCol:{display:'none'}}},
{MBR_RLTNSHP_CD:'19',majorDiagnosis:'Total Behavioral Health',inpatientFacility:'$231,344',outpatientFacility:'$281,208',professional:'$1,458,163',totalPaid:'$1,970,714',percentOfTotal:'100.0%',uniqueClaimants:'1,165',paidAmountPerClaimant:'$41,211.57',dummyCol:'',attr:{MBR_RLTNSHP_CD:{display:'none'},dummyCol:{display:'none'}}},
{MBR_RLTNSHP_CD:'22',majorDiagnosis:'All Other Behavioral Health',inpatientFacility:'$12,108',outpatientFacility:'$10,221',professional:'$21,696',totalPaid:'$44,026',percentOfTotal:'100.0%',uniqueClaimants:'*',paidAmountPerClaimant:'*',dummyCol:'',attr:{MBR_RLTNSHP_CD:{rowspan:'2'},dummyCol:{rowspan:'2'}}},
{MBR_RLTNSHP_CD:'22',majorDiagnosis:'Total Behavioral Health',inpatientFacility:'$12,108',outpatientFacility:'$10,221',professional:'$21,696',totalPaid:'$44,026',percentOfTotal:'100.0%',uniqueClaimants:'*',paidAmountPerClaimant:'*',dummyCol:'',attr:{MBR_RLTNSHP_CD:{display:'none'},dummyCol:{display:'none'}}},
];
arrtSetting = function (rowId, val, rawObject, cm) {
var attr = rawObject.attr[cm.name], result;
if (attr.rowspan) {
result = ' rowspan=' + '"' + attr.rowspan + '"';
} else if (attr.display) {
result = ' style="display:' + attr.display + '"';
}
return result;
};
gridVar.jqGrid({
datatype: 'local',
data: mydata,
colNames: ['','MBR_RLTNSHP_CD','Major Diagnosis','Inpatient Facility','Outpatient Facility','Professional','Total Paid','Percent of Total Behavioral Health','Unique Claimants Per Major Diagnosis','Behavioral Health Paid Amount per Claimant'] ,
colModel: [
{ name: 'dummyCol', width: 80, align: 'center', cellattr: arrtSetting},
{ name: 'MBR_RLTNSHP_CD', width: 150, align: 'center', cellattr: arrtSetting, formatter : totalFmatter},
{ name: 'majorDiagnosis', width : 180, align : 'left', formatter : totalFmatter },
{ name: 'inpatientFacility', width : 100, align : 'right' },
{ name: 'outpatientFacility', width : 100, align : 'right'},
{ name: 'professional', width : 110, align : 'right'},
{ name: 'totalPaid', width : 110, align : 'right'},
{ name: 'percentOfTotal', width : 120, align: 'right'},
{ name: 'uniqueClaimants', width : 120, align: 'right'},
{ name: 'paidAmountPerClaimant', width : 130, align: 'right'}
],
cmTemplate: {sortable: false},
rowNum: 500,
gridview: true,
hoverrows: false,
autoencode: true,
ignoreCase: true,
viewrecords: true,
shrinkToFit : true,
height: '100%',
width: '100%',
grouping:true,
groupingView : {
groupField : ['MBR_RLTNSHP_CD'],
groupColumnShow : [false],
groupText : [ '<b>{0}</b>'],
groupCollapse : [ true],
groupOrder: [ 'asc'],
scroll: false,
rownumbers: false,
treeGrid: false,
gridview: true
},
beforeSelectRow: function () {
return false;
}
});
gridVar.jqGrid('setGroupHeaders', {
useColSpanStyle: false,
groupHeaders:[
{startColumnName: 'inpatientFacility', numberOfColumns: 5, align : 'center', titleText: 'Behavioral Health Paid Amount by Setting'},
{startColumnName: 'uniqueClaimants', numberOfColumns: 2, titleText: ''}
]
});
$(totalRows).each(function( index )
{
$("#"+totalRows[index]).children("td").css("font-weight","bold");
});
});
function totalFmatter(cellValue, options, rowdata, action)
{
if(cellValue.indexOf('Total') == 0){
totalRows[rowCount++]= options.rowId;
}
return cellValue ;
}
</script>
</body>
Most Users Ever Online: 715
Currently Online:
33 Guest(s)
Currently Browsing this Page:
1 Guest(s)
Top Posters:
OlegK: 1255
markw65: 179
kobruleht: 144
phicarre: 132
YamilBracho: 124
Renso: 118
Member Stats:
Guest Posters: 447
Members: 11373
Moderators: 2
Admins: 1
Forum Stats:
Groups: 1
Forums: 8
Topics: 10592
Posts: 31289
Newest Members:
, razia, Prankie, psky, praveen neelam, greg.valainis@pa-tech.comModerators: tony: 7721, Rumen[Trirand]: 81
Administrators: admin: 66