Class: HtmlGrid::AbstractSelect

Inherits:
NamedComponent show all
Defined in:
lib/htmlgrid/select.rb

Direct Known Subclasses

Select

Constant Summary collapse

LABEL =
true

Constants inherited from Component

Component::CSS_CLASS, Component::CSS_ID, Component::HTML_ATTRIBUTES, Component::HTTP_HEADERS

Instance Attribute Summary collapse

Attributes inherited from NamedComponent

#name

Attributes inherited from Component

#attributes, #dojo_tooltip, #label, #model, #value

Instance Method Summary collapse

Methods inherited from NamedComponent

#data_origin, #error?, #init, #initialize

Methods inherited from Component

#_to_html, #autofill?, #css_class, #css_class=, #css_id, #css_id=, #dojo_dynamic_html, #dojo_parse_on_load, #dojo_tag, #dojo_title=, #dynamic_html, #escape, #escape_symbols, #formname, #http_headers, #initialize, #label?, #onclick=, #onload=, #onsubmit=, #set_attribute, #tabindex=

Constructor Details

This class inherits a constructor from HtmlGrid::NamedComponent

Instance Attribute Details

#selectedObject

Returns the value of attribute selected.



32
33
34
# File 'lib/htmlgrid/select.rb', line 32

def selected
  @selected
end

#valid_valuesObject

Returns the value of attribute valid_values.



32
33
34
# File 'lib/htmlgrid/select.rb', line 32

def valid_values
  @valid_values
end

Instance Method Details

#to_html(context) ⇒ Object



33
34
35
36
37
38
# File 'lib/htmlgrid/select.rb', line 33

def to_html(context)
  context.select(@attributes) {
    sel = selection(context)
    sel.is_a?(Array) ? sel.join : sel.to_s
  }
end