Class: HtmlGrid::UlComposite

Inherits:
TagComposite show all
Defined in:
lib/htmlgrid/ulcomposite.rb

Direct Known Subclasses

UlList

Constant Summary

Constants inherited from AbstractComposite

AbstractComposite::CSS_CLASS, AbstractComposite::CSS_ID, AbstractComposite::CSS_ID_MAP, AbstractComposite::CSS_MAP, AbstractComposite::CSS_STYLE_MAP, AbstractComposite::DEFAULT_CLASS, AbstractComposite::LABELS, AbstractComposite::LEGACY_INTERFACE, AbstractComposite::LOOKANDFEEL_MAP, AbstractComposite::SYMBOL_MAP

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, #label, #model, #value

Instance Method Summary collapse

Methods inherited from TagComposite

#compose, #create, #insert_row, #label, #setup_grid, #submit, #tag_attributes

Methods inherited from AbstractComposite

component, #create, #init

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

Instance Method Details

#to_html(context) ⇒ Object



31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# File 'lib/htmlgrid/ulcomposite.rb', line 31

def to_html(context)
  res = ""
  res << context.ul(tag_attributes) {
    inner_res = ""
    @grid.each_with_index { |li, idx|
      inner_res << context.li(tag_attributes(idx)) {
        if li.respond_to?(:to_html)
          li.to_html(context).force_encoding("utf-8")
        else
          li
        end
      }
    }
    inner_res
  }
  res
end