Class: Wice::Columns::ViewColumnRange

Inherits:
ViewColumn show all
Defined in:
lib/wice/columns/column_range.rb

Overview

:nodoc:

Constant Summary

Constants inherited from ViewColumn

Wice::Columns::ViewColumn::FIELDS

Instance Attribute Summary

Attributes inherited from ViewColumn

#cell_rendering_block, #contains_a_text_input, #custom_filter, #filter_control_options, #grid, #main_table, #table_name

Instance Method Summary collapse

Methods inherited from ViewColumn

#add_css_class, #attribute_name_fully_qualified_for_all_but_main_table_columns, #auto_reloading_input_with_negation_checkbox?, #capable_of_hosting_filter_related_icons?, #config, #controller, #css_class, #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_select?, #initialize, #render_filter, #table_alias_or_table_name, #yield_declaration

Methods included from ActionView::Helpers::TagHelper

#public_tag_options

Constructor Details

This class inherits a constructor from Wice::Columns::ViewColumn

Instance Method Details

#has_auto_reloading_input?Boolean

:nodoc:

Returns:

  • (Boolean)


31
32
33
# File 'lib/wice/columns/column_range.rb', line 31

def has_auto_reloading_input? #:nodoc:
  auto_reload
end

#render_filter_internal(params) ⇒ Object

:nodoc:



4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/wice/columns/column_range.rb', line 4

def render_filter_internal(params) #:nodoc:
  @contains_a_text_input = true

  @query,  _, parameter_name,  @dom_id  = form_parameter_name_id_and_query(fr: '')
  @query2, _, parameter_name2, @dom_id2 = form_parameter_name_id_and_query(to: '')

  opts1 = { size: 2, id: @dom_id,  class: 'form-control input-sm range-start' }
  opts2 = { size: 2, id: @dom_id2, class: 'form-control input-sm range-end' }

  if auto_reload
    opts1[:class] += ' auto-reload'
    opts2[:class] += ' auto-reload'
  end

  (
    :div,
    text_field_tag(parameter_name,  params[:fr], opts1) + text_field_tag(parameter_name2, params[:to], opts2),
    class: 'form-inline')
end

#yield_declaration_of_column_filterObject

:nodoc:



24
25
26
27
28
29
# File 'lib/wice/columns/column_range.rb', line 24

def yield_declaration_of_column_filter #:nodoc:
  {
    templates: [@query, @query2],
    ids:       [@dom_id, @dom_id2]
  }
end