Sha256: 66769ad3ba3955a1b8f7c50bcc24f88e5de2d2f52d3889dd77bd222aa65104eb
Contents?: true
Size: 1.52 KB
Versions: 6
Compression:
Stored size: 1.52 KB
Contents
// ======================================================================== // SproutCore // copyright 2006-2008 Sprout Systems, Inc. // ======================================================================== require('views/view') ; // RadioGroupView manages a collection of buttons as a single value. To // use this view, just assign your buttons as outlets. This will use the // toggleOnValue you have already set. SC.RadioGroupView = SC.View.extend({ // this is the current value or values of the radio group view. The // items in the radio group will be selected based on this value. value: null, // enable/disable the views in this group view. isEnabled: true, // PRIVATE METHODS init: function() { sc_super() ; // find the list of buttons to update and set them up. var loc = this.outlets.length ; var ret = [] ; var valuePropertyPath = [this,'value']; while(--loc >= 0) { var key = this.outlets[loc] ; var button = this[key] ; if (button && (button.toggleOnValue !== undefined)) { button.bind('value', valuePropertyPath) ; ret.push(button); } } this._radioButtons = ret ; }, // forward changes to the isEnabled property to children. _isEnabledObserver: function() { var newFlag = this.get('isEnabled') ; if (!this.didChangeFor('_isEnabled','isEnabled')) return ; if (this._radioButtons) { this._radioButtons.invoke('set','isEnabled',newFlag) ; } }.observes('isEnabled') }) ;
Version data entries
6 entries across 6 versions & 1 rubygems