Hi. I have to create a radio grid column. The main idea is that one row can be set as "default".
i make it this way:
data: {id,name,isDefault}.
where isDefault = 1 radiobutton checked.
On click on some other row on radiobutton it have to set isDefault=1. and where it was isDefault=1 set it to 0. All ok and i write this staff and it works. But code look not nice. Need help with rewriting it.

PHP Code:
Ext.define('Ext.grid.RowSetDefault', {
        
extend'Ext.grid.column.Column',
        
alias'widget.RowSetDefault',
        
width20,
        
sortablefalse,
        
constructor : function(config){
            
this.callParent(arguments);
            if (
this.rowspan) {
                
this.renderer Ext.Function.bind(this.rendererthis);
            }
        },
        
// private
        
fixedtrue,
        
hideablefalse,
        
menuDisabledtrue,
        
renderer: function(valuemetaDatarecordrowIdxcolIdxstore) {
            
// console.log();
            
            
return '<input '+(record.data.isDefault==1?'checked=checked':'')+' onchange="setDefault('+rowIdx+',\''+store.storeId+'\');" type=radio name="rgrp'+this.body.id+'">'//myEl //
        
}
        
    });

    function 
setDefault(rowIdx,storeId)
    {
        for(
index in Ext.getStore(storeId).data.items)
        {
            if(
Ext.getStore(storeId).data.items[index].data.isDefault==1)
                
Ext.getStore(storeId).data.items[index].set('isDefault',0);   
        }
        
Ext.getStore(storeId).data.items[rowIdx].set('isDefault',1);
    }