PDA

View Full Version : [FIXED] [2.1] radiofield group not able to assign/get value if ui='checkbox'



ingo.hefti
21 Dec 2012, 5:57 AM
rem the ui config or change 'checkbox' to 'radio' and it will work.



var form = Ext.create('Ext.form.Panel', {
fullscreen: true,
items: [{
xtype: 'toolbar',
docked: 'top',
items: [{
text: 'set checked (senchatouch)',
handler: function (btn, evt) {
var value = 'senchatouch',
radio = btn.up('formpanel').down('radiofield[name=product]');
if (!radio.setGroupValue(value)) {
Ext.Msg.alert(value + ' was not found');
} // if
} // handler
}] // items (toolbar)
}, {
xtype: 'fieldset',
defaults: {
xtype: 'radiofield',
labelWidth: 180,
name: 'product',
ui: 'checkbox'
}, // defaults
items: [{
label: 'Ext JS',
value: 'extjs'
}, {
label: 'Sencha Touch',
value: 'senchatouch'
}, {
label: 'Sencha Designer',
value: 'designer'
}] // items (fieldset)
}] // items (panel)
}); // create()


The sample is from http://senchaexamples.com/2012/03/15/programmatically-setting-the-selected-item-for-an-ext-field-radio-control-in-sencha-touch-2/

mitchellsimoens
21 Dec 2012, 8:25 AM
looks like the getSameGroupFields is trying to match elements with '.x-field-radio' cls but the fields have '.x-field-checkbox' so the element is not found resulting in the components not found.