API Docs for: 1.0.0
Show:

AtLeastOneCheckboxGroup Class

At least one checkbox must be selected. If the last one is turned off, the active, adjacent one is turned on. The exact algorithm is explained in "Tog on Interface". The checkboxes are assumed to be ordered in the order they were added.

Constructor

AtLeastOneCheckboxGroup

(
  • cb_list
)

Parameters:

  • cb_list String | Node | NodeList

    The list of checkboxes to manage

Methods

allChecked

() Boolean

Returns:

Boolean: true if all checkboxes are checked

allDisabled

() Boolean

Returns:

Boolean: true if all checkboxes are disabled

allUnchecked

() Boolean

Returns:

Boolean: true if all checkboxes are unchecked

checkboxChanged

(
  • cb
)
Call this if you modify the checkbox programmatically, since that will not fire a click event.

Parameters:

  • cb Node | String
    checkbox that was modified

enforceConstraints

(
  • cb_list
  • index
)

Parameters:

  • cb_list String | Object | Array

    The list of checkboxes

  • index Int

    The index of the checkbox that changed

getCheckboxList

() NodeList

Returns:

NodeList: List of managed checkboxes

splice

(
  • start
  • delete_count
  • cb_list
)
Same functionality as Array.splice(). Operates on the list of managed checkboxes.

Parameters:

  • start Int
    Insertion index
  • delete_count Int
    Number of items to remove, starting from start
  • cb_list String | Node | NodeList
    The list of checkboxes to insert at start