allow setting of the value without firing an event

This commit is contained in:
Damien Churchill 2009-10-12 16:45:28 +00:00
parent 23c949d4ec
commit c3f433500b
1 changed files with 30 additions and 27 deletions

View File

@ -763,36 +763,39 @@ Ext.reg('fullprogressbar', Ext.ux.FullProgressBar);
// Allow radiogroups to be treated as a single form element. // Allow radiogroups to be treated as a single form element.
Ext.override(Ext.form.RadioGroup, { Ext.override(Ext.form.RadioGroup, {
afterRender: function() { afterRender: function() {
var that = this; var that = this;
this.items.each(function(i) { this.items.each(function(i) {
that.relayEvents(i, ['check']); that.relayEvents(i, ['check']);
}); });
Ext.form.RadioGroup.superclass.afterRender.call(this) Ext.form.RadioGroup.superclass.afterRender.call(this)
}, },
getName: function() { getName: function() {
return this.items.first().getName(); return this.items.first().getName();
}, },
getValue: function() { getValue: function() {
var v; var v;
v = this.items.first().getGroupValue();
//this.items.each(function(item) {
// v = item.getRawValue();
// return !item.getValue();
//});
return v;
},
this.items.each(function(item) { setValue: function(v) {
v = item.getRawValue(); if (!this.items.each) return;
return !item.getValue(); this.items.each(function(item) {
}); var checked = (item.el.getValue() == String(v));
if (item.rendered) {
return v; item.el.dom.checked = checked;
}, item.el.dom.defaultChecked = checked;
item.wrap[checked ? 'addClass' : 'removeClass'](item.checkedCls);
setValue: function(v) { }
if (!this.items.each) return; });
this.items.each(function(item) { }
var checked = (item.el.getValue() == String(v));
item.setValue(checked);
});
}
}); });
Ext.ux.form.SpinnerGroup = Ext.extend(Ext.form.CheckboxGroup, { Ext.ux.form.SpinnerGroup = Ext.extend(Ext.form.CheckboxGroup, {