Skip to content
This repository was archived by the owner on Jun 14, 2021. It is now read-only.

Radiobox

Steve Ruiz edited this page Feb 3, 2018 · 2 revisions

A Radiobox is part of a group of radioboxes, only one of which may be checked at any given time. A Radiobox must be given an array as its group property.


Constructor

radioboxes = []

for i in [0...3]
    new Radiobox
        group: radioboxes
        #checked: false

Properties

radiobox.group <array>

An array that the Radiobox will belong to. The array will be given a property, active, that will hold the index of the checked Radiobox.

radioboxes = []

for i in [0...3]
    myRadiobox = new Radiobox
        group: radioboxes

radiobox.checked <boolean>

Whether the Radiobox is checked. When a Radiobox is checked, all other Radiobox instances in its group array will be unchecked.

checkboxes = []

for i in [0...3]
    myRadiobox = new Radiobox
        group: checkboxes
        checked: true

    myRadiobox.checked = false

    myRadiobox.on "change:checked", (checked) ->
        print 'Is radiobox checked? ' + checked
Clone this wiki locally