v 1.1.3


A CheckBox Element. It can either have a label, or not. Bindable to Backbone.Model objects. By default, a HTML input checkbox element is used. However - if you need to style your checkboxes, you can always set custom = true when creating a checkbox, so a DIV will be used instead of the HTML input element.



The following list of parameters can be used in the params object, passed to the constructor. Parameters in [brackets] are optional.



A label to be placed next to the checkbox


A tooltip to be applied on the button - will be displayed on mouse over.


Set to true, to use a span tag rather than an input[type=checkbox] tag to have more styling options.


Set a model here to bind the checkboxes value to a Backbone.Model property (type should be Boolean)


This is mandatory for using the model parameter. This is the string key of the models property to use


Optionally set an initial value for the checkbox. (true/false)


A string with custom CSS classes to apply to the generated DOM element


A object with attributes to assign to the generated DOM element. Omit the "data-" part. So for example {count: 1} becomes data-count="1" on the DOM element.


The jQuery enhanced DOM element to be generated. If nothing is set, a standard DIV container will be created. If you want to use a different DOM element, pass a jQuery generated DOM element to this parameter.


The default show effect for the element. See associated property description. Default: null


The default hide effect for the element. See associated property description. Default: null



Can be used to retrieve the current check status of the object.

Inherited Properties from modo.Element


Contains the jQuery enhanced DOM Node of this modoJS element.


Contains a internally given, numeric ID for this element.


Will be set by .show() and .hide(). Access this property to check the current visibility of the element.


Set a default show effect (like the options you can pass to the show() / hide() methods.


element.showEffect = {
    effect: 'slideDown',
    effectArgs: ['fast']


Define a default hide effect instead of a simple, instant hide.



Enables the button to capture clicks. Removes the CSS-Class mdo-disabled from its DOM element. Triggers the Backbone Event "enabled".


Disables the button to not capture any clicks. Adds the CSS-Class mdo-disabled to its DOM element. Triggers the Backbone Event "disabled".


Pass true or false here to change the elements value manually. If the element is bound to a model, the models property will be changed as well.


Returns the current value.

Inherited Methods from modo.Element


Pass either true or false to this value to make the element stretch inside a modo.FlexContainer element.


Make the connected DOM object visible and trigger the Backbone Event "show".

You can control the way the element is shown by passing an object of options.


    effect: 'slideDown',
    effectArgs: ['fast']


Make the connected DOM object invisible and trigger the Backbone Event "hide".

You can control the hide effect the same way as with the show() method.

addClass(classname, doPrefix)this

Will add another class name to the DOM element. The class name will be automatically prefixed (i.e. with mdo-) if doPrefix = true (default).

removeClass(classname, doPrefix)this

Will remove a class name from the DOM element. The class name will be automatically prefixed.

addClassTemporary(classname, timeout, doPrefix)this

Helps with adding a classname temporarily to the object. Just call this method and after the specified amount of time, the added class(es) will be removed.

Note: All modoJS Objects are extended with all methods of the Backbone.Events class.



Triggered when the elements value has been changed through set().


Triggered, when the button is enabled and a user has clicked on it.

Event parameterDescription


The click event object


Triggered, when the button has been enabled through enable().


Triggered, when the button has been disabled through disable().

Inherited Events from modo.Element


Triggered, when the object has been displayed through show()


Triggered, when the object has been hidden through hide()

CSS Classes


Applied on the element. Also applied to a span tag inside the element to act as a checker when the custom property has been set to true.


Applied to a span tag to act as a label.


Applied to the element when the elements value is set to true.


Applied when the element has been disabled through disable(). Will be removed after a call to enable().

Inherited CSS Classes from modo.Element


Basic class that will be applied to every element that extends modo.Element.


Will be applied to every modo element where setFlexible(true) has been called upon.

comments powered by Disqus