我有2个问题要放在这里。
1)我在jqgrid标题中有一个复选框。检查后,应检查所有复选框,取消选中后,应取消选中所有复选框。我正在努力做到这一点。请帮助我。
2)我还有另外一件事要实施。我没有设置multiseleted:true,因为它会在每一行显示复选框。我必须根据某些条件显示复选框。如果条件满足,那么只有复选框必须出现。 (我甚至不能禁用它。它应该完全隐形)。如何控制?
寻求帮助!!
我的Jqgrid代码就像
jQuery(document).ready(function(){
jQuery("#progAccessSearchResults").jqGrid({
url: searchUrl,
colNames: ['Id', 'Name','Distr Type','Run No','Start Date','End Date','Access Type','Tigress Status','','Last Updated','Source','<input type="checkbox" onclick="checkBoxChecked(event)" />'],
colModel: [
{name:'id', index:'id', hidden : true},
// {name:'season', index:'SEASON', hidden : progHide, width: 80, resizable: false},
{name:'name', index:'NAME', width: 120, resizable: false},
{name:'distType', index:'DIST_TYPE_NAME', width: 140, resizable: false},
{name:'runNo', index:'RUN_NO', hidden : progHide, width: 150, resizable: false},
{name:'startDate', index:'B2B_START_DT', width: 90, resizable: false},
{name:'endDate', index:'B2B_END_DT', width: 90, resizable: false},
{name:'accessType', index:'OVERRIDDEN', width: 80,resizable: false},
{name:'contractStatus',index:'contract_status',width:80,resizable:false},
{name:'act',index:'act', sortable:false, hidden : adminHide, align:"center", width: 80, resizable: false},
{name:'lastUpdated',index:'last_updated_dt', hidden : true},
{name:'source',index:'source', hidden : true},
{name: 'checkbox', index: 'checkbox', editable:true, edittype:'checkbox',align:"center",hidden : adminHide, editoptions: { value:"True:False",defaultvalue:"False"}, formatter: "checkbox", formatoptions: {disabled : false} }
],
datatype : 'json',
mtype: 'POST',
width: '920',
height: 'auto',
rownumbers: false,
rownumWidth: 40,
sortname : 'last_updated_dt',
sortorder : 'desc',
scrollOffset : 0,
toppager: true,
rowNum : jqrowNum,
rowList : jqRecordsPerPageList,
viewrecords : true,
gridview : false,
cellEdit : false,
caption : 'Search Results',
hidegrid : false,
pager : jQuery('#progAccessSearchResultsPager'),
multiselect : false,
toolbar: [true,"top,bottom"],
jsonReader: { repeatitems : false, id: "0" },
gridComplete: function(){
var recs = parseInt(jQuery("#progAccessSearchResults").getGridParam("records"),10);
if (recs == 0) {
jQuery("#gridWrapper").hide();
jQuery(".noResMsg").show();
}
else {
jQuery('#gridWrapper').show();
jQuery(".noResMsg").hide();
}
},
});
// End jqgrid script
});