Class: HtmlGrid::Link
- Inherits:
-
NamedComponent
- Object
- Component
- NamedComponent
- HtmlGrid::Link
- Defined in:
- lib/htmlgrid/link.rb
Constant Summary
Constants inherited from Component
Component::CSS_CLASS, Component::CSS_ID, Component::HTML_ATTRIBUTES, Component::HTTP_HEADERS, Component::LABEL
Instance Attribute Summary
Attributes inherited from NamedComponent
Attributes inherited from Component
#attributes, #dojo_tooltip, #model, #value
Instance Method Summary collapse
- #href ⇒ Object
- #href=(url) ⇒ Object
- #init ⇒ Object
- #target=(trg) ⇒ Object
- #to_html(context) ⇒ Object
Methods inherited from NamedComponent
#data_origin, #error?, #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=, #label?, #onclick=, #onload=, #onsubmit=, #set_attribute, #tabindex=
Constructor Details
This class inherits a constructor from HtmlGrid::NamedComponent
Instance Method Details
#href ⇒ Object
35 36 37 |
# File 'lib/htmlgrid/link.rb', line 35 def href @attributes['href'] end |
#href=(url) ⇒ Object
38 39 40 |
# File 'lib/htmlgrid/link.rb', line 38 def href=(url) @attributes['href'] = url end |
#init ⇒ Object
31 32 33 34 |
# File 'lib/htmlgrid/link.rb', line 31 def init super @value = @lookandfeel.lookup(@name) end |
#target=(trg) ⇒ Object
41 42 43 |
# File 'lib/htmlgrid/link.rb', line 41 def target=(trg) @attributes['target'] = trg end |
#to_html(context) ⇒ Object
44 45 46 47 48 49 50 51 52 |
# File 'lib/htmlgrid/link.rb', line 44 def to_html(context) context.a(@attributes) { if(@value.respond_to?(:to_html)) @value.to_html(context).force_encoding('utf-8') else super end } << dynamic_html(context) end |