Got this to work.
The Direct Store:
Code:
Application.Data.RoleStore = new Ext.data.DirectStore({
paramsAsHash: false,
root: 'ROWS',
totalProperty:'DATASET',
autoLoad:true,
directFn: Application.Data.ss['icefyre.com.objects.RoleService'].getAllRoles,
fields: [
{name:'Role_ID',type:'int'},
{name:'Role',type:'string'}
],
listeners: {
load:{
fn: function(st,recs,opts)
{
var rGroup = Ext.getCmp('RoleFieldGroup');
rGroup.items.length = 0;
Ext.each(recs, function(item)
{
checked = false;
if(item.data.Role_ID === 3)
checked = true
rGroup.items.push({
xtype: 'radio',
boxLabel: item.data.Role,
inputValue: item.data.Role_ID,
name: 'RoleField',
checked: checked
});
});
rGroup.doLayout();
}
},
loadexception: {
fn: function()
{
}
}
}
})
The RadioGroup in my FormPanel:
Code:
{
xtype: 'radiogroup',
fieldLabel: 'Role',
id:'RoleFieldGroup',
columns: 1,
items: [
{boxLabel: 'Standard User', name: 'RoleField', inputValue:'1', checked: true}
]
}
Hope that helps someone else. If there is a way to do it better let me know.
Thanks