I'm trying to setup a column in a jqGrid that has one radio button per row in it, to allow the user to set a single row as the "primary" child of the parent. The following code, however, merely renders empty cells.
I imagine the cells are not being put into 'edit mode' or whatever, which is confusing to me because there's an editable checkbox column on the same grid which just works as desired.
(There's a navButton at the bottom of the grid that saves the state of the grid if that's relevant.)
var createRadioButton = function(value) {
return $("<input type='radio' />", {
name: mySubGridID,
checked: value
}).get();
}
var extractFromRadioButton = function(elem) {
return $(elem).val();
}
$("#grid").jqGrid({
url: '/GetData',
datatype: 'json',
colModel: [
...
{ label: 'Selected', name: 'selected', index: 'selected', editable: true, edittype: 'custom', editoptions:
{
custom_element: createRadioButton,
custom_value: extractFromRadioButton
}
},
...
],
...
});
Thanks for any help!