Class: PhlexKit::DataTableSelectAllCheckbox

Inherits:
BaseComponent
  • Object
show all
Defined in:
app/components/phlex_kit/data_table/data_table_select_all_checkbox.rb

Overview

Header checkbox selecting every DataTableRowCheckbox on the page (the controller sets indeterminate for partial selections). See data_table.rb.

Instance Method Summary collapse

Methods inherited from BaseComponent

#on

Constructor Details

#initialize(**attrs) ⇒ DataTableSelectAllCheckbox

Returns a new instance of DataTableSelectAllCheckbox.



5
6
7
# File 'app/components/phlex_kit/data_table/data_table_select_all_checkbox.rb', line 5

def initialize(**attrs)
  @attrs = attrs
end

Instance Method Details

#view_templateObject



9
10
11
12
13
14
15
16
17
# File 'app/components/phlex_kit/data_table/data_table_select_all_checkbox.rb', line 9

def view_template
  render Checkbox.new(**mix({
    aria: { label: "Select all" },
    data: {
      phlex_kit__data_table_target: "selectAll",
      action: "change->phlex-kit--data-table#toggleAll"
    }
  }, @attrs))
end