PDA

View Full Version : radiogroup oddity



heidtmare
7 May 2009, 9:55 AM
in my move to 3.0 I changed this:



{
xtype: 'radiogroup',
fieldLabel: ' ',
itemCls: 'x-check-group-alt',
columns: 1,
hideLabel: true,
items: [{
id:'SW_searchForm_geospatial_mapExtent',
name:'boundingType',
boxLabel: 'Map Viewport',
checked:true,
handler:function(item,checked){
SW.Map.BoundingBox.setVisibility(!checked);
}
},{
id:'SW_searchForm_geospatial_boundingbox',
name:'boundingType',
boxLabel: 'Custom bounding box',
checked: false,
handler:function(item,checked){
Ext.getCmp('SW_searchForm_geospatial_boundingboxButtons').setVisible(checked);
}
}]
}
to this:



{
xtype: 'radiogroup',
fieldLabel: ' ',
//itemCls: 'x-check-group-alt',
columns: 1,
hideLabel: true,
items: [{
id:'SW_searchForm_geospatial_mapExtent',
name:'boundingType',
boxLabel: 'Map Viewport',
checked:true,
listeners:{
'check':function(item,checked){
SW.Map.BoundingBox.setVisibility(!checked);
}
}
},{
id:'SW_searchForm_geospatial_boundingbox',
name:'boundingType',
boxLabel: 'Custom bounding box',
checked: false,
listeners:{
'check':function(item,checked){
Ext.getCmp('SW_searchForm_geospatial_boundingboxButtons').setVisible(checked);
}
}
}]
}
because handler doesnt appear to be supported anymore, but now my form doesnt render correctly.
Everything after the "Map Viewport" radio doenst render.
Ive checked the syntax a bajillion times, what am i missing?

EDIT: if i comment out the "listeners" portion everything renders perfectly...

Condor
7 May 2009, 11:15 AM
The check event fires before the component is rendered. Can the listener handle that?

heidtmare
7 May 2009, 11:28 AM
ah, so an if(item.rendered == true)... should do the trick, thanx.

EDIT:

nevermind that wont work either :(
i want my handler back [cry]

I'll have to dig into my mapping class and add some load checks. oh well.