Class: UiBibz::Ui::Ux::Tables::Actions
- Inherits:
-
Object
- Object
- UiBibz::Ui::Ux::Tables::Actions
- Defined in:
- lib/ui_bibz/ui/ux/tables/components/actions.rb
Instance Attribute Summary collapse
-
#format_action ⇒ Object
readonly
Returns the value of attribute format_action.
Instance Method Summary collapse
- #divider ⇒ Object
- #format(&block) ⇒ Object
- #header(content = nil, options = nil, html_options = nil, &block) ⇒ Object
- #html(content) ⇒ Object
-
#initialize(store) ⇒ Actions
constructor
A new instance of Actions.
-
#link(content = nil, options = nil, html_options = nil, &block) ⇒ Object
Add link action in table.
-
#list ⇒ Object
Get all actions.
- #raw_list ⇒ Object
- #reset ⇒ Object
Constructor Details
#initialize(store) ⇒ Actions
Returns a new instance of Actions.
8 9 10 11 12 |
# File 'lib/ui_bibz/ui/ux/tables/components/actions.rb', line 8 def initialize(store) @store = store @actions = [] @action_order = -1 end |
Instance Attribute Details
#format_action ⇒ Object (readonly)
Returns the value of attribute format_action.
48 49 50 |
# File 'lib/ui_bibz/ui/ux/tables/components/actions.rb', line 48 def format_action @format_action end |
Instance Method Details
#divider ⇒ Object
19 20 21 |
# File 'lib/ui_bibz/ui/ux/tables/components/actions.rb', line 19 def divider @actions << UiBibz::Ui::Core::Forms::Dropdowns::Components::DropdownDivider.new.render end |
#format(&block) ⇒ Object
35 36 37 |
# File 'lib/ui_bibz/ui/ux/tables/components/actions.rb', line 35 def format(&block) @format_action = block end |
#header(content = nil, options = nil, html_options = nil, &block) ⇒ Object
23 24 25 |
# File 'lib/ui_bibz/ui/ux/tables/components/actions.rb', line 23 def header(content = nil, = nil, = nil, &block) @actions << UiBibz::Ui::Core::Forms::Dropdowns::Components::DropdownHeader.new(content, , , &block).render end |
#html(content) ⇒ Object
27 28 29 |
# File 'lib/ui_bibz/ui/ux/tables/components/actions.rb', line 27 def html(content) @actions << content end |
#link(content = nil, options = nil, html_options = nil, &block) ⇒ Object
Add link action in table
15 16 17 |
# File 'lib/ui_bibz/ui/ux/tables/components/actions.rb', line 15 def link(content = nil, = nil, = nil, &block) @actions << UiBibz::Ui::Core::Forms::Dropdowns::Components::DropdownLink.new(content, , , &block).render end |
#list ⇒ Object
Get all actions
40 41 42 |
# File 'lib/ui_bibz/ui/ux/tables/components/actions.rb', line 40 def list @actions.empty? ? defaults_actions : @actions end |
#raw_list ⇒ Object
44 45 46 |
# File 'lib/ui_bibz/ui/ux/tables/components/actions.rb', line 44 def raw_list @actions end |
#reset ⇒ Object
31 32 33 |
# File 'lib/ui_bibz/ui/ux/tables/components/actions.rb', line 31 def reset @actions = [] end |