Class: KirguduBase::DynamicPages::Filter
- Inherits:
-
Property
- Object
- Element
- PageElement
- Property
- KirguduBase::DynamicPages::Filter
- Defined in:
- app/models/kirgudu_base/dynamic_pages/filter.rb
Instance Attribute Summary collapse
-
#events ⇒ Object
Returns the value of attribute events.
-
#input_type ⇒ Object
Returns the value of attribute input_type.
Attributes inherited from Property
#data_source, #description, #format, #help, #label, #parent, #placeholder, #text_value_property, #tooltip
Attributes inherited from PageElement
#enabled, #html_options, #id, #name, #use_i18n, #visible
Attributes inherited from Element
Instance Method Summary collapse
- #events_for_json ⇒ Object
-
#initialize(options = {}) ⇒ Filter
constructor
A new instance of Filter.
- #must_have_data_source? ⇒ Boolean
Methods inherited from Property
Methods inherited from PageElement
#i18n_data_as_string, #to_external_hash
Methods inherited from Element
#as_json, #fix_parent_entry, #kontroller_klass, #to_external_hash
Methods included from Models::MergeableElements::ClassMethods
#get_mergeable_attributes, #mergeable_attributes
Methods included from Models::FixableElements::ClassMethods
#fixable_attributes, #get_kb_fixable_attributes
Methods included from Models::FixableElements::InstanceMethods
Methods included from Models::MergeableElements::InstanceMethods
Constructor Details
#initialize(options = {}) ⇒ Filter
Returns a new instance of Filter.
14 15 16 17 18 19 |
# File 'app/models/kirgudu_base/dynamic_pages/filter.rb', line 14 def initialize( = {}) self.input_type = :text_edit self.events = {} super() end |
Instance Attribute Details
#events ⇒ Object
Returns the value of attribute events.
22 23 24 |
# File 'app/models/kirgudu_base/dynamic_pages/filter.rb', line 22 def events @events end |
#input_type ⇒ Object
Returns the value of attribute input_type.
21 22 23 |
# File 'app/models/kirgudu_base/dynamic_pages/filter.rb', line 21 def input_type @input_type end |
Instance Method Details
#events_for_json ⇒ Object
25 26 27 |
# File 'app/models/kirgudu_base/dynamic_pages/filter.rb', line 25 def events_for_json self.events ? self.events.map { |e| e.to_external_hash(nil) } : {} end |
#must_have_data_source? ⇒ Boolean
30 31 32 |
# File 'app/models/kirgudu_base/dynamic_pages/filter.rb', line 30 def must_have_data_source? [:chosen_select, :select, :autocomplete_with_id, :autocomplete].include?(self.input_type) end |