PDA

View Full Version : RadioColumn



SagarAw
26 Jun 2012, 6:19 PM
Hi ,

I wanted to use the radioColumn for the entire rows instead of just a single (name,radio) pair.
I have used the following code snippet for the same : -




//Following radioColumn definition uses the custom radioColumn
var selectColumn = new Hypo.grid.RadioColumn({ header: '',
id: 'sColumn',
dataIndex: 'selected',
sortable: false,
align: 'center',
width: 25
});

//Following declarations are for initializing the dataStore
var memoryProxy = new Ext.data.MemoryProxy(Hypo.reports.advisors.data);


var nameRecord = Ext.data.Record.create([
{name: 'userId', mapping: 'userId'},
{name: 'fname', mapping: 'firstName', sortType: Ext.data.SortTypes.asUCString},
{name: 'lname', mapping: 'lastName', sortType: Ext.data.SortTypes.asUCString},
{name: 'login', mapping: 'login', sortType: Ext.data.SortTypes.asUCString},
{name: 'email', mapping: 'email', sortType: Ext.data.SortTypes.asUCString},
]);


var arrayReader = new Ext.data.ArrayReader({}, nameRecord);


var dataStore = new Ext.data.Store({
reader: arrayReader,
proxy : memoryProxy,
data : Hypo.reports.advisors.data
});

//Following is the declaration of the grid which displays the data with 5 columns showing data and last one
//for radioColumn
var grid = new Hypo.grid.GridPanel({
store: dataStore,
id: 'grid',
columns: [
{
header: "UserId",
width: 50,
sortable: true,
dataIndex: 'userId',
id: 'userId'
},{
header: "First Name",
width: 200,
sortable: true,
dataIndex: 'fname',
id: 'fname'
},{
header: "Last Name",
width: 200,
sortable: true,
dataIndex: 'lname',
id: 'lname'
},{
header: "Login",
width: 200,
sortable: true,
dataIndex: 'login'
},
{
header: "Email",
width: 200,
sortable: true,
dataIndex: 'email'
},

selectColumn
],
frame: true,
autoHeight: true,
loadMask: true,
plugins: selectColumn
});


Can anyone suggest how can I retrieve the value of the row which is being selected by the radioColumn, in this case ?