In your code you are setting the group text as below :-
groupText : ['<input name="chkHideTest" type="checkbox" class="groupHeader" isHidden="1" /> {0} '],
Two things i added here like below :-
1. Name to the checkbox element like name="chkHideTest" and
2. one custom attribute named 'isHidden' then set its value to 1 for which you want to make it hidden otherwise zero, by checking the data coming from database.
In actuall the expand button is rendered as below code :-
<table><tbody><tr><td style="padding-left:0px;" colspan="8"><span style="cursor:pointer;" class="ui-icon tree-wrap-ltr ui-icon-circlesmall-minus" onclick="jQuery('#grid').jqGrid('groupingToggle','gridghead_0_0');return false;"></span><input name="chkHideTest" type="checkbox" isHidden="1" class="groupHeader" name="grpHeader"> test </td></tr></tbody></table>
So the just before element for the group input checkbox is the expand button which you want to disable/invisible there.
So we need to add a new setting for the grid as below which will be fired just after the load completion of the jqGrid as mentioned below :-
loadComplete:function(){
$.each($("input[name='chkHideTest']"), function(i, obj){
var isHidden= $(obj).attr('ishidden');
if(isHidden)
{
$(obj).prev().hide();
}
});
},
}
So this will hide the specific expand button which you dont want to view or else you can disable it by modifying the code a bit.
Hope this will definitely of help to you.