class TaoUi::Components::TreeComponent

Attributes

children_key[R]
expanded[R]
items[R]
remote[R]
selectable[R]

Public Class Methods

component_name() click to toggle source
# File lib/tao_ui/components/tree_component.rb, line 28
def self.component_name
  :tree
end
new(view, items, options = {}) click to toggle source
Calls superclass method
# File lib/tao_ui/components/tree_component.rb, line 7
def initialize view, items, options = {}
  super view,options
  @items = items
  @children_key = @options.delete(:children_key)
  @selectable = @options[:selectable] || false
  @remote = @options.delete(:remote)
  @expanded = @options.delete(:expanded)
end

Public Instance Methods

render(&block) click to toggle source
# File lib/tao_ui/components/tree_component.rb, line 16
def render &block
  view.content_tag tag_name, html_options do
    view.tao_tree_list items, {
      depth: 0,
      selectable: selectable,
      remote: remote,
      expanded: expanded,
      children_key: children_key
    }, &block
  end
end

Private Instance Methods

default_options() click to toggle source
# File lib/tao_ui/components/tree_component.rb, line 34
def default_options
  {class: 'tao-tree', children_key: :children}
end