SelectAllListController

new SelectAllListController()

INTERNAL CODE DOCUMENTATION COMPLETE

Select All Switch List Controller

A sophisticated Stimulus controller that provides automatic "Select All" functionality for Bootstrap form-switch checkbox lists. Creates and manages a master checkbox that controls all individual checkboxes with bidirectional synchronization.

Key Features:

  • Automatic "Select All" header checkbox generation
  • Bidirectional synchronization between master and individual checkboxes
  • Bootstrap form-switch styling consistency
  • Dynamic checkbox discovery and event management
  • Accessibility support with ARIA labels
  • Automatic state management for partial selections

Extends

  • Controller

Members

allCheckboxes :NodeList

Collection of all checkboxes in the list including the master checkbox

Type:
  • NodeList

Methods

connect()

Initialize controller and generate Select All functionality Creates master checkbox, sets up event listeners, and establishes synchronization

updateSelectAll(event)

Handle checkbox state changes and maintain synchronization Manages bidirectional relationship between master and individual checkboxes Updates master checkbox state based on individual selections

Parameters:
NameTypeDescription
eventEvent

The change event from any checkbox in the list