Please try the code below:
$.extend($.fn.datagrid.defaults.editors, {
workingRadioGroup:{
index: 1,
init: function(container, options){
var span = $('<span></span>').appendTo(container);
var name = 'radio_'+this.index++;
$.map(options.items||[], function(item){
var checked = item.value == options.value ? 'checked' : '';
$('<input type="radio" name="'+name+'" value="'+item.value+'" '+checked+'>' + item.text + '</input>').appendTo(span);
});
return span;
},
destroy: function(target){
$(target).remove();
},
getValue: function(target){
return $(target).find('input:checked').val();
},
setValue: function(target, value){
$(target).find('input[value='+value+']')._propAttr('checked', true);
},
resize: function(target, width){
}
}
})
Usage example:
<th data-options="field:'productid',width:100,
editor:{
type:'workingRadioGroup',
options:{
value: '1',
items:[
{value:'0',text:'No'},
{value:'1',text:'Yes'},
{value:'2',text:'Maybe'}
]
}
}">Product</th>