Class: PhlexKit::DataTableRowCheckbox
- Inherits:
-
BaseComponent
- Object
- Phlex::HTML
- BaseComponent
- PhlexKit::DataTableRowCheckbox
- Defined in:
- app/components/phlex_kit/data_table/data_table_row_checkbox.rb
Overview
Per-row selection checkbox (a PhlexKit::Checkbox submitting ids[]).
See data_table.rb.
Instance Method Summary collapse
-
#initialize(value:, name: "ids[]", label: nil, **attrs) ⇒ DataTableRowCheckbox
constructor
A new instance of DataTableRowCheckbox.
- #view_template ⇒ Object
Methods inherited from BaseComponent
Constructor Details
#initialize(value:, name: "ids[]", label: nil, **attrs) ⇒ DataTableRowCheckbox
Returns a new instance of DataTableRowCheckbox.
5 6 7 8 9 10 |
# File 'app/components/phlex_kit/data_table/data_table_row_checkbox.rb', line 5 def initialize(value:, name: "ids[]", label: nil, **attrs) @value = value @name = name @label = label @attrs = attrs end |
Instance Method Details
#view_template ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 |
# File 'app/components/phlex_kit/data_table/data_table_row_checkbox.rb', line 12 def view_template render Checkbox.new(**mix({ name: @name, value: @value, aria: { label: @label || "Select row #{@value}" }, data: { phlex_kit__data_table_target: "rowCheckbox", action: "change->phlex-kit--data-table#toggleRow" } }, @attrs)) end |