Class: UiBibz::Ui::Ux::Tables::Searchable

Inherits:
Base
  • Object
show all
Defined in:
lib/ui_bibz/ui/ux/tables/extensions/searchable.rb

Instance Attribute Summary

Attributes inherited from Base

#output_buffer

Instance Method Summary collapse

Methods inherited from Base

#generate_id, #i18n_set?, #inject_url

Constructor Details

#initialize(store, options, html_options = nil) ⇒ Searchable

Returns a new instance of Searchable.



5
6
7
8
9
# File 'lib/ui_bibz/ui/ux/tables/extensions/searchable.rb', line 5

def initialize(store, options, html_options = nil)
  @store        = store
  @options      = options
  @html_options = html_options
end

Instance Method Details

#renderObject

Render html tag



12
13
14
15
16
17
18
# File 'lib/ui_bibz/ui/ux/tables/extensions/searchable.rb', line 12

def render
   :div, @html_options do
    concat (:div, table_name, class: 'title')
    concat TableSearchField.new({ store: @store, wrap_form: @options[:wrap_form] }).render if searchable?
    concat tag :br, class: 'ui-bibz-clear'
  end
end

#searchable?Boolean

Returns:

  • (Boolean)


20
21
22
# File 'lib/ui_bibz/ui/ux/tables/extensions/searchable.rb', line 20

def searchable?
  @options[:searchable].nil? ? true : @options[:searchable]
end