Class: Wice::ActionViewColumn

Inherits:
ViewColumn show all
Defined in:
lib/view_columns.rb

Overview

:nodoc:

Constant Summary

Constants inherited from ViewColumn

ViewColumn::FIELDS

Instance Attribute Summary

Attributes inherited from ViewColumn

#cell_rendering_block, #contains_a_text_input, #css_class, #custom_filter, #grid, #main_table, #model_class, #table_name

Instance Method Summary collapse

Methods inherited from ViewColumn

#auto_reloading_input_with_negation_checkbox?, #config, #controller, #detachness, #filter_shown?, #filter_shown_in_main_table?, #form_parameter_name_id_and_query, #has_auto_reloading_calendar?, #has_auto_reloading_input?, #has_auto_reloading_select?, #render_filter, #render_filter_internal, #yield_declaration_of_column_filter, #yield_javascript

Constructor Details

#initialize(grid_obj, td_html_attrs, param_name, select_all_buttons, object_property, view) ⇒ ActionViewColumn

:nodoc:



137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
# File 'lib/view_columns.rb', line 137

def initialize(grid_obj, td_html_attrs, param_name, select_all_buttons, object_property, view)  #:nodoc:
  @view = view
  @select_all_buttons   = select_all_buttons
  self.grid             = grid_obj
  self.td_html_attrs    = td_html_attrs
  self.td_html_attrs.add_or_append_class_value!('sel')
  grid_name             = self.grid.name
  @param_name           = param_name
  debugger
  @cell_rendering_block = lambda do |object, params|
    selected = if params[grid_name] && params[grid_name][param_name] &&
                  params[grid_name][param_name].index(object.send(object_property).to_s)
      true
    else
      false
    end
    check_box_tag("#{grid_name}[#{param_name}][]", object.send(object_property), selected, :id => nil)
  end
end

Instance Method Details

:nodoc:

Returns:

  • (Boolean)


161
162
163
# File 'lib/view_columns.rb', line 161

def capable_of_hosting_filter_related_icons?  #:nodoc:
  false
end

#column_nameObject

:nodoc:



165
166
167
168
169
170
171
172
173
174
175
176
177
178
# File 'lib/view_columns.rb', line 165

def column_name  #:nodoc:
  return '' unless @select_all_buttons
  select_all_tootip   = WiceGridNlMessageProvider.get_message(:SELECT_ALL)
  deselect_all_tootip = WiceGridNlMessageProvider.get_message(:DESELECT_ALL)

  html = (:span, image_tag(Defaults::TICK_ALL_ICON, :alt => select_all_tootip),
                     :class => 'clickable select_all', :title => select_all_tootip) + ' ' +
         (:span, image_tag(Defaults::UNTICK_ALL_ICON, :alt => deselect_all_tootip),
                     :class => 'clickable deselect_all', :title => deselect_all_tootip)

  js = JsAdaptor.action_column_initialization(grid.name)

  [html, js]
end

#in_htmlObject

:nodoc:



157
158
159
# File 'lib/view_columns.rb', line 157

def in_html  #:nodoc:
  true
end