Currently, I am attempting to integrate radio buttons within a jqGrid framework. I am aware that a custom formatter can be utilized for this purpose. Below is my code snippet, however, it fails to provide information on which radio button is selected or if one is selected at all.
On all occasions, the value returned is "undefined."
// Definition of the custom formatter
function radio(value, options, rowObject){
var radioHtml = '<input type="radio" value=' + value + ' name="radioid" />';
return radioHtml;
}
// Excerpt from the colModel within the jqGrid definition
colModel:[
{name:'select', label:'Select', width: 60, align:'center', edittype:'custom',
editable:true, formatter: radio},
{name:'name', label: 'Source Disk Volume', width: 170}],
// Function invoked on submission
function evaluate() {
// Attempt 1
alert('val: '+$("[name='radioid']:checked").val());
// Attempt 2
tried to access the checked radio button using plain JavaScript
}
I am seeking assistance in retrieving the value of the selected radio button by the user.