columns: [[{
field: 'oid',
title: '選擇',
width: 20,
formatter: function(value, rowData, rowIndex){
return '<input type="radio" name="selectRadio" id="selectRadio"' + rowIndex + ' value="' + rowData.oid + '" />';
}
}
onLoadSuccess: function(data){
//加載完畢后獲取所有的checkbox遍歷
if (data.rows.length > 0) {
//循環判斷操作為新增的不能選擇
for (var i = 0; i < data.rows.length; i++) {
//根據operate讓某些行不可選
if (data.rows[i].operate == "false") {
$("input[type='radio']")[i].disabled = true;
}
}
}
},
onClickRow: function(rowIndex, rowData){
//加載完畢后獲取所有的checkbox遍歷
var radio = $("input[type='radio']")[rowIndex].disabled;
//如果當前的單選框不可選,則不讓其選中
if (radio!= true) {
//讓點擊的行單選按鈕選中
$("input[type='radio']")[rowIndex].checked = true;
}
else {
$("input[type='radio']")[rowIndex].checked = false;
}
}
field: 'oid',
title: '選擇',
width: 20,
formatter: function(value, rowData, rowIndex){
return '<input type="radio" name="selectRadio" id="selectRadio"' + rowIndex + ' value="' + rowData.oid + '" />';
}
}
onLoadSuccess: function(data){
//加載完畢后獲取所有的checkbox遍歷
if (data.rows.length > 0) {
//循環判斷操作為新增的不能選擇
for (var i = 0; i < data.rows.length; i++) {
//根據operate讓某些行不可選
if (data.rows[i].operate == "false") {
$("input[type='radio']")[i].disabled = true;
}
}
}
},
onClickRow: function(rowIndex, rowData){
//加載完畢后獲取所有的checkbox遍歷
var radio = $("input[type='radio']")[rowIndex].disabled;
//如果當前的單選框不可選,則不讓其選中
if (radio!= true) {
//讓點擊的行單選按鈕選中
$("input[type='radio']")[rowIndex].checked = true;
}
else {
$("input[type='radio']")[rowIndex].checked = false;
}
}