Class: Wice::Columns::ViewColumn
- Includes:
- ActionView::Helpers::AssetTagHelper, ActionView::Helpers::FormTagHelper, ActionView::Helpers::JavaScriptHelper, ActionView::Helpers::TagHelper
- Defined in:
- lib/wice/columns.rb
Overview
:nodoc:
Direct Known Subclasses
ViewColumnAction, ViewColumnCustomDropdown, ViewColumnDatetime, ViewColumnInteger, ViewColumnRange, ViewColumnString
Constant Summary collapse
- FIELDS =
fields defined from the options parameter
[:attribute, :name, :html, :filter, :model, :allow_multiple_selection, :in_html, :in_csv, :helper_style, :table_alias, :custom_order, :detach_with_id, :ordering, :auto_reload]
Instance Attribute Summary collapse
-
#cell_rendering_block ⇒ Object
Returns the value of attribute cell_rendering_block.
-
#contains_a_text_input ⇒ Object
readonly
Returns the value of attribute contains_a_text_input.
-
#custom_filter ⇒ Object
Returns the value of attribute custom_filter.
-
#grid ⇒ Object
Returns the value of attribute grid.
-
#main_table ⇒ Object
Returns the value of attribute main_table.
-
#model ⇒ Object
Returns the value of attribute model.
-
#table_name ⇒ Object
Returns the value of attribute table_name.
Instance Method Summary collapse
- #add_css_class(klass_value) ⇒ Object
-
#attribute_name_fully_qualified_for_all_but_main_table_columns ⇒ Object
bad name, because for the main table the name is not really ‘fully_qualified’.
-
#auto_reloading_input_with_negation_checkbox? ⇒ Boolean
:nodoc:.
-
#capable_of_hosting_filter_related_icons? ⇒ Boolean
:nodoc:.
-
#config ⇒ Object
:nodoc:.
-
#controller ⇒ Object
:nodoc:.
-
#css_class ⇒ Object
:nodoc:.
-
#detachness ⇒ Object
:nodoc:.
-
#filter_shown? ⇒ Boolean
:nodoc:.
-
#filter_shown_in_main_table? ⇒ Boolean
:nodoc:.
-
#form_parameter_name_id_and_query(v) ⇒ Object
:nodoc:.
-
#fully_qualified_attribute_name ⇒ Object
:nodoc:.
-
#has_auto_reloading_calendar? ⇒ Boolean
:nodoc:.
-
#has_auto_reloading_input? ⇒ Boolean
:nodoc:.
-
#has_auto_reloading_select? ⇒ Boolean
:nodoc:.
-
#initialize(block, options, grid_obj, tname, mtable, cfilter, view) ⇒ ViewColumn
constructor
:nodoc:.
-
#render_filter ⇒ Object
:nodoc:.
-
#render_filter_internal(params) ⇒ Object
:nodoc:.
-
#table_alias_or_table_name ⇒ Object
:nodoc:.
-
#yield_declaration ⇒ Object
:nodoc:.
-
#yield_declaration_of_column_filter ⇒ Object
:nodoc:.
Constructor Details
#initialize(block, options, grid_obj, tname, mtable, cfilter, view) ⇒ ViewColumn
:nodoc:
76 77 78 79 80 81 82 83 84 85 86 87 |
# File 'lib/wice/columns.rb', line 76 def initialize(block, , grid_obj, tname, mtable, cfilter, view) #:nodoc: self.cell_rendering_block = block self.grid = grid_obj self.table_name = tname self.main_table = mtable self.custom_filter = cfilter @view = view FIELDS.each do |field| self.send(field.to_s + '=', [field]) end end |
Instance Attribute Details
#cell_rendering_block ⇒ Object
Returns the value of attribute cell_rendering_block.
72 73 74 |
# File 'lib/wice/columns.rb', line 72 def cell_rendering_block @cell_rendering_block end |
#contains_a_text_input ⇒ Object (readonly)
Returns the value of attribute contains_a_text_input.
74 75 76 |
# File 'lib/wice/columns.rb', line 74 def contains_a_text_input @contains_a_text_input end |
#custom_filter ⇒ Object
Returns the value of attribute custom_filter.
72 73 74 |
# File 'lib/wice/columns.rb', line 72 def custom_filter @custom_filter end |
#grid ⇒ Object
Returns the value of attribute grid.
72 73 74 |
# File 'lib/wice/columns.rb', line 72 def grid @grid end |
#main_table ⇒ Object
Returns the value of attribute main_table.
72 73 74 |
# File 'lib/wice/columns.rb', line 72 def main_table @main_table end |
#model ⇒ Object
Returns the value of attribute model.
72 73 74 |
# File 'lib/wice/columns.rb', line 72 def model @model end |
#table_name ⇒ Object
Returns the value of attribute table_name.
72 73 74 |
# File 'lib/wice/columns.rb', line 72 def table_name @table_name end |
Instance Method Details
#add_css_class(klass_value) ⇒ Object
90 91 92 93 94 95 96 97 |
# File 'lib/wice/columns.rb', line 90 def add_css_class(klass_value) if html[:class].nil? html[:class] = klass_value else html[:class] << ' ' unless html[:class].empty? html[:class] << klass_value end end |
#attribute_name_fully_qualified_for_all_but_main_table_columns ⇒ Object
bad name, because for the main table the name is not really ‘fully_qualified’
150 151 152 |
# File 'lib/wice/columns.rb', line 150 def attribute_name_fully_qualified_for_all_but_main_table_columns #:nodoc: self.main_table ? attribute : table_alias_or_table_name + '.' + attribute end |
#auto_reloading_input_with_negation_checkbox? ⇒ Boolean
:nodoc:
180 181 182 |
# File 'lib/wice/columns.rb', line 180 def auto_reloading_input_with_negation_checkbox? #:nodoc: false end |
#capable_of_hosting_filter_related_icons? ⇒ Boolean
:nodoc:
172 173 174 |
# File 'lib/wice/columns.rb', line 172 def #:nodoc: self.attribute.blank? && self.name.blank? && ! self.filter_shown? end |
#config ⇒ Object
:nodoc:
123 124 125 |
# File 'lib/wice/columns.rb', line 123 def config #:nodoc: @view.config end |
#controller ⇒ Object
:nodoc:
127 128 129 |
# File 'lib/wice/columns.rb', line 127 def controller #:nodoc: @view.controller end |
#css_class ⇒ Object
:nodoc:
99 100 101 |
# File 'lib/wice/columns.rb', line 99 def css_class #:nodoc: html[:class] || '' end |
#detachness ⇒ Object
:nodoc:
107 108 109 |
# File 'lib/wice/columns.rb', line 107 def detachness #:nodoc: (! detach_with_id.blank?).to_s end |
#filter_shown? ⇒ Boolean
:nodoc:
159 160 161 |
# File 'lib/wice/columns.rb', line 159 def filter_shown? #:nodoc: self.attribute && self.filter end |
#filter_shown_in_main_table? ⇒ Boolean
:nodoc:
163 164 165 |
# File 'lib/wice/columns.rb', line 163 def filter_shown_in_main_table? #:nodoc: filter_shown? && ! self.detach_with_id end |
#form_parameter_name_id_and_query(v) ⇒ Object
:nodoc:
141 142 143 144 145 146 147 |
# File 'lib/wice/columns.rb', line 141 def form_parameter_name_id_and_query(v) #:nodoc: query = form_parameter_template(v) query_without_equals_sign = query.sub(/=$/,'') parameter_name = CGI.unescape(query_without_equals_sign) dom_id = id_out_of_name(parameter_name) return query, query_without_equals_sign, parameter_name, dom_id.tr('.', '_') end |
#fully_qualified_attribute_name ⇒ Object
:nodoc:
154 155 156 |
# File 'lib/wice/columns.rb', line 154 def fully_qualified_attribute_name #:nodoc: table_alias_or_table_name + '.' + attribute end |
#has_auto_reloading_calendar? ⇒ Boolean
:nodoc:
188 189 190 |
# File 'lib/wice/columns.rb', line 188 def has_auto_reloading_calendar? #:nodoc: false end |
#has_auto_reloading_input? ⇒ Boolean
:nodoc:
176 177 178 |
# File 'lib/wice/columns.rb', line 176 def has_auto_reloading_input? #:nodoc: false end |
#has_auto_reloading_select? ⇒ Boolean
:nodoc:
184 185 186 |
# File 'lib/wice/columns.rb', line 184 def has_auto_reloading_select? #:nodoc: false end |
#render_filter ⇒ Object
:nodoc:
132 133 134 135 |
# File 'lib/wice/columns.rb', line 132 def render_filter #:nodoc: params = @grid.filter_params(self) render_filter_internal(params) end |
#render_filter_internal(params) ⇒ Object
:nodoc:
137 138 139 |
# File 'lib/wice/columns.rb', line 137 def render_filter_internal(params) #:nodoc: '<!-- implement me! -->' end |
#table_alias_or_table_name ⇒ Object
:nodoc:
168 169 170 |
# File 'lib/wice/columns.rb', line 168 def table_alias_or_table_name #:nodoc: table_alias || table_name end |
#yield_declaration ⇒ Object
:nodoc:
111 112 113 114 115 116 117 118 119 120 |
# File 'lib/wice/columns.rb', line 111 def yield_declaration #:nodoc: declaration = yield_declaration_of_column_filter if declaration { :filterName => self.name, :detached => detachness, :declaration => declaration } end end |
#yield_declaration_of_column_filter ⇒ Object
:nodoc:
103 104 105 |
# File 'lib/wice/columns.rb', line 103 def yield_declaration_of_column_filter #:nodoc: nil end |