Module classes.helpers.vSelection

(bool) enforce that at least one item remains selected at all times

Functions

clear_selection ()
select_all ()
toggle_index (idx) toggle a selected bar on or off, depending on its current state
contains_index (idx) check if a given index is selected
set_indices (t) GETTERS & SETTERS
set_require_selection (val)
set_index (idx)
set_mode (val)

Fields

self.mode (vSelection.SELECT_MODE) single or multi-selection?
self.index (int) the index of the (first) selected item, or 0 when no selection note: setting this property while in multi-select mode will "collapse" the selection to a single item, while getting will return the first item
self.indices (table) note: the sequence reflects the order in which the items were selected: if you select the third item, and then the first item, this property contains an array of values in the following sequence: {3,1}
self.num_items (int) vSelection does not contain a direct reference to the data - instead you provide it with @num_items - this is used for determining if a given index is valid, how many items to select when selecting all


Functions

clear_selection ()

Returns:

  1. bool (true when changed)
  2. table (removed_items)
  3. bool (true when changed)
  4. table (added_items)
select_all ()

Returns:

  1. bool (true when changed)
  2. table (added_items)
toggle_index (idx)
toggle a selected bar on or off, depending on its current state

Parameters:

  • idx

Returns:

  1. bool (true when changed)
  2. table (added_items)
  3. table (removed_items)
contains_index (idx)
check if a given index is selected

Parameters:

  • idx (number)

Returns:

    int (index)
set_indices (t)
GETTERS & SETTERS

Parameters:

  • t

Returns:

  1. bool (true when changed, false on invalid index or mode)
  2. table>int (added_items)
  3. table>int (removed_items)
  4. bool (when changed)
  5. table (added_items)
  6. table (removed_items)
set_require_selection (val)

Parameters:

  • val

Returns:

  1. bool (when changed)
  2. table (added_items)
  3. table (removed_items)
  4. bool (when changed)
  5. table (added_items)
  6. table (removed_items)
set_index (idx)

Parameters:

  • idx

Returns:

  1. bool (when changed)
  2. table (added_items)
  3. table (removed_items)
  4. bool (when changed)
  5. table (added_items)
  6. table (removed_items)
set_mode (val)

Parameters:

  • val

Returns:

  1. bool (when changed)
  2. table (added_items)
  3. table (removed_items)

Fields

self.mode
(vSelection.SELECT_MODE) single or multi-selection?
self.index
(int) the index of the (first) selected item, or 0 when no selection note: setting this property while in multi-select mode will "collapse" the selection to a single item, while getting will return the first item
self.indices
(table) note: the sequence reflects the order in which the items were selected: if you select the third item, and then the first item, this property contains an array of values in the following sequence: {3,1}
self.num_items
(int) vSelection does not contain a direct reference to the data - instead you provide it with @num_items - this is used for determining if a given index is valid, how many items to select when selecting all
generated by LDoc 1.4.2