Class: PhlexKit::DataTable
- Inherits:
-
BaseComponent
- Object
- Phlex::HTML
- BaseComponent
- PhlexKit::DataTable
- Defined in:
- app/components/phlex_kit/data_table/data_table.rb
Overview
Data table, ported from ruby_ui's RubyUI::DataTable: a server-driven
sortable/searchable table living in a .pk-data-table* (data_table.css).
Instance Method Summary collapse
-
#initialize(id:, **attrs) ⇒ DataTable
constructor
A new instance of DataTable.
- #view_template(&block) ⇒ Object
Methods inherited from BaseComponent
Constructor Details
#initialize(id:, **attrs) ⇒ DataTable
Returns a new instance of DataTable.
14 15 16 17 |
# File 'app/components/phlex_kit/data_table/data_table.rb', line 14 def initialize(id:, **attrs) @id = id @attrs = attrs end |
Instance Method Details
#view_template(&block) ⇒ Object
19 20 21 22 23 |
# File 'app/components/phlex_kit/data_table/data_table.rb', line 19 def view_template(&block) turbo_frame(id: @id, target: "_top") do div(**mix({ class: "pk-data-table", data: { controller: "phlex-kit--data-table" } }, @attrs), &block) end end |