Forum

November 2nd, 2014
A A A
Avatar

Lost password?
Advanced Search

— Forum Scope —




— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

The forums are currently locked and only available for read only access
sp_Feed Topic RSS sp_TopicIcon
subgrid does not expand when grouping is active
20/08/2014
21:59
Avatar
lili5058
Member
Members
Forum Posts: 7
Member Since:
09/08/2013
sp_UserOfflineSmall Offline

I'm using jqGrid 4.6.0 on a grid with both subGrid:true and grouping:true, but when I click the '+' symbol to show the subGrid, nothing happens.

Doing a little debugging showed me that it died in the jqQuery code somewhere and my subGridRowExpanded callback function is never called.

21/08/2014
17:00
Avatar
tony
Sofia, Bulgaria
Moderator
Members

Moderators
Forum Posts: 7721
Member Since:
30/10/2007
sp_UserOfflineSmall Offline

Hello,

 

It all depends how you do this.

Maybe you want to show your code.

 

Regards

For professional UI suites for Java Script and PHP visit us at our commercial products site - guriddo.net - by the very same guys that created jqGrid.

27/08/2014
22:29
Avatar
lili5058
Member
Members
Forum Posts: 7
Member Since:
09/08/2013
sp_UserOfflineSmall Offline

Here is the text from

var billGrid;
var colModelNames = [ 'serviceName', 'CI_NAME', 'volumeName','CI_TYPE','UDDS', 'amount', 'billingCodeCmdb', 'ovrrdBillingCode', 'isSplitBilling', 'billingCodeType'];
var emptyMsgDiv = $('There are no unposted rows');
$(function(){
var targetPage = 1;
billGrid = $("#list").jqGrid({
url:"${createLink(controller:'storageBilling', action:'getSummaryBillData', params:[id:billing.id, postedStatus: 'canBePosted'])}",
datatype: 'json',
mtype: 'GET',
colNames:[ 'SEO Service billed', 'CI billed', 'Volume Name','CI Type','UDDS', 'Amount Billed','CMDB Billing code','Billing Code Override', 'Split', 'Billing Code Type', 'SourceBillable'],
colModel :[
{name:colModelNames[0],width:60, sortable:true, sorttype:'text'},
{name:colModelNames[1], width:50, editable:true, edittype:'text', formatter:formatCiName},
{name:colModelNames[2], width:70, sortable:true, sorttype:'text'},
{name:colModelNames[3], width:50, sortable:true, sorttype:'text'},
{name:colModelNames[4], width:30, sortable:true},
{name:colModelNames[5], width:30, sortable:true, align:'right', formatter:'currency', sorttype:'currency',
formatoptions:{decimalPlaces:0,prefix:'$'},summaryType:'sum'},
{name:colModelNames[6], width:50, editable:true, sortable:true},
{name:colModelNames[7], width:50, editable:true, sortable:true},
{name:colModelNames[8], width:50},
{name:colModelNames[9],hidden:true},
{name:'sourceBillable', hidden:true}
],
width: '1000',
toppager:true,
height: '100%',
pager: '#pager',
rowNum:1000,
rowList:[10,20,50,100,1000],
viewrecords: true,
gridview: true,
jsonReader:{repeatitems: false},
loadonce: true,
footerrow : true,
grouping:true,
groupingView: {
groupField:['billingCodeType','billingCodeCmdb'],
groupOrder:['asc','asc'],
groupSummary:[true,true],
groupColumnShow:[false,false],
groupCollapse:false,
},
subGrid: true,
subGridRowExpanded: function(subgrid_id, row_id) {
var subgrid_table_id;
subgrid_table_id = subgrid_id+"_t";
jQuery("#"+subgrid_id).html("<table id='"+subgrid_table_id+"' class='scroll'></table>");
jQuery("#"+subgrid_table_id).jqGrid({
url:'${createLink(controller:'billableServiceItem', action:'getDetails')}&id=' + row_id,
datatype: "json",
colNames: ['CI Validation Notes','Billing Code Validation Notes','Base CI Data'],
colModel: [
{name:"valnotes",index:"valnotes",width:200, cellattr:detailsFormatter},
{name:"billval",index:"billval",width:200, cellattr:detailsFormatter},
{name:"cidetails",index:"cidetails",width:400,formatter:ciDetailsFormatter},
],
height: '100%',
});
function ciDetailsFormatter(cellvalue, options, rowObject){
var ciObj = jQuery.parseJSON(cellvalue);
var ciObjStr = "";
for (var prop in ciObj){
if (ciObj.hasOwnProperty(prop)){
ciObjStr = ciObjStr + prop + ": " + ciObj[prop] + ", ";
}
}
return '' + ciObjStr + '';
};
function detailsFormatter(rowId, val, rawObject, cm){
return 'class="wrapTableCell"';
};
},
caption: 'Storage Items to be billed',
loadComplete: onLoadComplete,
}).navGrid('#list_toppager', {add:false, del:false, edit:false, refresh:false, search:false},{},{},{},{},{});

29/08/2014
10:49
Avatar
tony
Sofia, Bulgaria
Moderator
Members

Moderators
Forum Posts: 7721
Member Since:
30/10/2007
sp_UserOfflineSmall Offline

Hello,

 

In subGridRowExpanded you define custom functions ciDetailsFormatter and function detailsFormatter.

These are executed every time you expand the grid and of course this will bring a error

Define these functions outside this subgrid scope.

The more simple way is just to use very simple subgrid and then add other custom things.

Regards

For professional UI suites for Java Script and PHP visit us at our commercial products site - guriddo.net - by the very same guys that created jqGrid.

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

Currently Online:
39 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.com

Moderators: tony: 7721, Rumen[Trirand]: 81

Administrators: admin: 66

Comments are closed.
Privacy Policy   Terms and Conditions   Contact Information