There are rowExpand() and rowCollapse() methods to individually expand and collapse details of a row.
If you want to collapse all details at once, please use the code below:
var data = $gridMain.pqGrid('option',"dataModel").data;
for(var i=0;i<data.length;i++){
var rowData = data[i];
if(rowData.pq_detail){
rowData.pq_detail.show = false;
}
}
$gridMain.pqGrid("refresh");