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

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

Instance Method Summary (collapse)

Constructor Details

- (Actions) initialize(store)

Returns a new instance of Actions



7
8
9
10
11
# File 'lib/ui_bibz/ui/ux/table/components/actions.rb', line 7

def initialize store
  @store        = store
  @actions      = []
  @action_order = -1
end

Instance Method Details

- (Object) divider



18
19
20
# File 'lib/ui_bibz/ui/ux/table/components/actions.rb', line 18

def divider
  @actions << UiBibz::Ui::Core::DropdownDivider.new.render
end

- (Object) format(&block)



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

def format &block
  @format_action = block
end

- (Object) format_action



39
40
41
# File 'lib/ui_bibz/ui/ux/table/components/actions.rb', line 39

def format_action
  @format_action
end

- (Object) header(content = nil, options = nil, html_options = nil, &block)



22
23
24
# File 'lib/ui_bibz/ui/ux/table/components/actions.rb', line 22

def header content = nil, options = nil, html_options = nil, &block
  @actions << UiBibz::Ui::Core::DropdownHeader.new(content, options, html_options, &block).render
end

Add link action in table



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

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

- (Object) list

Get all actions



35
36
37
# File 'lib/ui_bibz/ui/ux/table/components/actions.rb', line 35

def list
  @actions.empty? ? defaults_actions : @actions
end

- (Object) reset



26
27
28
# File 'lib/ui_bibz/ui/ux/table/components/actions.rb', line 26

def reset
  @actions = []
end