Class: Wice::ViewColumnDate

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

Overview

:nodoc:

Constant Summary collapse

@@datetime_chunk_names =
%w(year month day)

Constants inherited from ViewColumn

Wice::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 ViewColumnDatetime

#has_auto_reloading_calendar?, #name_and_id_from_options, #prepare_for_calendar_filter, #prepare_for_standard_filter, #yield_declaration_of_column_filter

Methods included from JsCalendarHelpers

#date_calendar_jquery, #date_calendar_prototype, #datetime_calendar_prototype

Methods included from ActionView::Helpers::TagHelper

#tag_options

Methods inherited from ViewColumn

#attribute_name_fully_qualified_for_all_but_main_table_columns, #auto_reloading_input_with_negation_checkbox?, #capable_of_hosting_filter_related_icons?, #detachness, #filter_shown?, #filter_shown_in_main_table?, #form_parameter_name_id_and_query, #fully_qualified_attribute_name, #has_auto_reloading_calendar?, #has_auto_reloading_input?, #has_auto_reloading_select?, #initialize, #render_filter, #table_alias_or_table_name, #yield_declaration_of_column_filter, #yield_javascript

Constructor Details

This class inherits a constructor from Wice::ViewColumn

Instance Method Details

#render_calendar_filter_internal(params) ⇒ Object

:nodoc:


395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
# File 'lib/view_columns.rb', line 395

def render_calendar_filter_internal(params) #:nodoc:

  calendar_helper_method = if Wice::ConfigurationProvider.value_for(:JS_FRAMEWORK) == :prototype
    :date_calendar_prototype
  else
    :date_calendar_jquery
  end

  html1, js1 = send(calendar_helper_method, params[:fr], @view,
    {:include_blank => true, :prefix => @name1, :fire_event => auto_reload, :grid_name => self.grid.name},
    :title => WiceGridNlMessageProvider.get_message(:DATE_SELECTOR_TOOLTIP_FROM))
  html2, js2 = send(calendar_helper_method, params[:to], @view,
    {:include_blank => true, :prefix => @name2, :fire_event => auto_reload, :grid_name => self.grid.name},
    :title => WiceGridNlMessageProvider.get_message(:DATE_SELECTOR_TOOLTIP_TO))

  [%!<div class="date-filter">#{html1}<br/>#{html2}</div>!, js1 + js2]
end

#render_filter_internal(params) ⇒ Object

:nodoc:


413
414
415
416
417
418
419
420
421
422
# File 'lib/view_columns.rb', line 413

def render_filter_internal(params) #:nodoc:

  if helper_style == :standard
    prepare_for_standard_filter
    render_standard_filter_internal(params)
  else
    prepare_for_calendar_filter
    render_calendar_filter_internal(params)
  end
end

#render_standard_filter_internal(params) ⇒ Object

:nodoc:


388
389
390
391
392
393
# File 'lib/view_columns.rb', line 388

def render_standard_filter_internal(params) #:nodoc:
  '<div class="date-filter">' +
  select_date(params[:fr], {:include_blank => true, :prefix => @name1, :id => @dom_id}) + '<br/>' +
  select_date(params[:to], {:include_blank => true, :prefix => @name2, :id => @dom_id2}) +
  '</div>'
end