Sha256: 4275e01894aa165e40139a08d6459483b092b246b98a8cf4a490705638e16b87
Contents?: true
Size: 1.07 KB
Versions: 12
Compression:
Stored size: 1.07 KB
Contents
// ======================================================================== // SproutCore // copyright 2006-2008 Sprout Systems, Inc. // ======================================================================== require('views/field/field') ; /** @class Supports using platform native checkboxs with the input field. If you would like to make use of the extended SproutCore checkbox features including a mixed state and theming support, use SC.CheckboxView instead. @extends SC.FieldView @author Charles Jolley @version 1.0 */ SC.CheckboxFieldView = SC.FieldView.extend( /** @scope SC.CheckboxFieldView.prototype */ { emptyElement: '<input type="checkbox" value="1" />', setFieldValue: function(value) { this.rootElement.checked = !!value; }, getFieldValue: function() { return this.rootElement.checked; }, valueBindingDefault: SC.Binding.Bool, init: function() { arguments.callee.base.apply(this,arguments) ; var f = this.fieldValueDidChange.bind(this, false) ; Event.observe(this.rootElement,'click', f) ; } }) ;
Version data entries
12 entries across 12 versions & 1 rubygems