Class: UiBibz::Ui::Ux::Tables::Actions

Inherits:
Object
  • Object
show all
Defined in:
lib/ui_bibz/ui/ux/tables/components/actions.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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_actionObject (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

#dividerObject



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, options = nil, html_options = nil, &block)
  @actions << UiBibz::Ui::Core::Forms::Dropdowns::Components::DropdownHeader.new(content, options, html_options, &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

Add link action in table



15
16
17
# File 'lib/ui_bibz/ui/ux/tables/components/actions.rb', line 15

def link(content = nil, options = nil, html_options = nil, &block)
  @actions << UiBibz::Ui::Core::Forms::Dropdowns::Components::DropdownLink.new(content, options, html_options, &block).render
end

#listObject

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_listObject



44
45
46
# File 'lib/ui_bibz/ui/ux/tables/components/actions.rb', line 44

def raw_list
  @actions
end

#resetObject



31
32
33
# File 'lib/ui_bibz/ui/ux/tables/components/actions.rb', line 31

def reset
  @actions = []
end