Class: HtmlGrid::RichText

Inherits:
Component show all
Defined in:
lib/htmlgrid/richtext.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 Component

#attributes, #dojo_tooltip, #model, #value

Instance Method Summary collapse

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::Component

Instance Method Details

#<<(element) ⇒ Object



13
14
15
# File 'lib/htmlgrid/richtext.rb', line 13

def <<(element)
	@elements.push(element)
end

#initObject



9
10
11
12
# File 'lib/htmlgrid/richtext.rb', line 9

def init
	super
	@elements = []
end

#to_html(context) ⇒ Object



16
17
18
19
20
21
22
23
24
# File 'lib/htmlgrid/richtext.rb', line 16

def to_html(context)
	@elements.collect { |element|
		if(element.respond_to?(:to_html))
			element.to_html(context).force_encoding('utf-8')
		else
			element.to_s
		end
	}.join(' ')
end