标签:his radio put query ctr tab bre var let
代码如下:
colModel: [
{name: ‘radiokey‘, width: 10,align:‘center‘},
{name: ‘templatekey‘, key: true, width: 75,align:‘center‘},
{name: ‘templatename‘, width: 150, editable: true,align:‘center‘},
],
gridComplete:function(){
var ids = jQuery("#jqGrid").jqGrid(‘getDataIDs‘);
//单选按钮
for (var i = 0; i < ids.length; i++) {
var cl = ids[i];
var ret = jQuery("#jqGrid").jqGrid(‘getRowData‘, cl);
bnEdt = "<input type=‘radio‘ name=‘myname‘ value=‘" + ret.templatekey + "‘onclick=‘setmyval(" + cl + ");‘ />";
jQuery("#jqGrid").jqGrid(‘setRowData‘, cl, {
radiokey: bnEdt
});
}
},
onSelectRow: function(rowid){
var radios = $($(this)[0]).find("input[name=‘myname‘]");
for(var i=0;i<radios.length;i++){
if(radios[i].value==rowid){
radios[i].checked = true;
break;
}
}
}
function setmyval(id){
radiokey = id;
$("#jqGrid").setSelection(id);
}
标签:his radio put query ctr tab bre var let
原文地址:http://www.cnblogs.com/seeusmile-cnblog/p/7644970.html