colModel :[{
name:'id' ,index:'id',hidden:true
},{name:'rdobtn',index:'rdobtn',align:'center',width:20
},{name:'name',index:'name',align:'center'
},{name:'remark',index:'remark',align:'center'
},{name:'displayTime',index:'displayTime',align:'center'
},{name : 'domainName',index : 'domainName',width : 100,align : 'left'
},{name : 'batchMon',index : 'batchMon',width : 100,align : 'left'
},{name : 'domainCode',index : 'domainCode',width : 100,align : 'left'
}],
pager: '#dbhGridPage',
height:280,
autowidth : true,
multiselect: false,
viewrecords : true,
gridComplete:function(){
var ids=jQuery("#dbhGridList").getDataIDs();
for(var i=0; i<ids.length; i++){
var cl=ids[i];
rowDatas = $("#dbhGridList").jqGrid('getRowData', cl);
var radioBtn = "<input type='radio' name='rdoid' οnchange='rdoChange("+cl+")'/>";
jQuery("#dbhGridList").jqGrid('setRowData', cl, {
rdobtn : radioBtn
});
}
},
jsonReader : {
repeatitems: false
},
onSelectRow: function(rowid,status,e) {
$('#'+rowid).find("input[name='rdoid']")[0].checked = true;
}
function rdoChange(cl){
//点击radio设置行选中
$('#dbhGridList').setSelection(cl);
}
jqGrid 设置radio
最新推荐文章于 2023-05-03 09:09:34 发布