Class: UU::OS::GVC::Table
- Inherits:
-
Component
- Object
- Component
- UU::OS::GVC::Table
- Defined in:
- uu_os_gvc-0.28.16/lib/uu/os/gvc/table.rb
Overview
Table component.
Instance Attribute Summary (collapse)
-
- (Boolean) visible
Flag if table is visible in form.
Attributes inherited from Component
#attributes, #code, #component_type, #form, #height, #id, #name, #width
Instance Method Summary (collapse)
-
- (UU::OS::GVC::TableRow?) get_row(index)
Returns row object on specific index.
-
- (Array) get_rows_by_code(code)
Returns array of table row objects with specific code.
-
- (Table) initialize(container, data = nil)
constructor
Creates new instance of Table.
-
- (Numeric) number_of_rows
(also: #size)
Returns number of rows in Table.
Methods inherited from Component
#add_message, #focus, #messages
Constructor Details
- (Table) initialize(container, data = nil)
Creates new instance of Table.
15 16 17 18 19 20 21 22 23 |
# File 'uu_os_gvc-0.28.16/lib/uu/os/gvc/table.rb', line 15 def initialize(container, data = nil) super(container, data) if rows.kind_of?Array rows.map!{ |row_data| UU::OS::GVC::TableRow.new(row_data) } end end |
Instance Attribute Details
- (Boolean) visible
Flag if table is visible in form. Default is true. If is set to false table is completely hidden.
38 39 40 |
# File 'uu_os_gvc-0.28.16/lib/uu/os/gvc/table.rb', line 38 def visible @visible end |
Instance Method Details
- (UU::OS::GVC::TableRow?) get_row(index)
Returns row object on specific index.
58 59 60 |
# File 'uu_os_gvc-0.28.16/lib/uu/os/gvc/table.rb', line 58 def get_row(index) rows[index] end |
- (Array) get_rows_by_code(code)
Returns array of table row objects with specific code. If nil is entered as the code, than all rows without a defined code are returned.
79 80 81 82 83 |
# File 'uu_os_gvc-0.28.16/lib/uu/os/gvc/table.rb', line 79 def get_rows_by_code(code) rows.select{|row| row.code == code } end |
- (Numeric) number_of_rows Also known as: size
Returns number of rows in Table. May be zero.
95 96 97 |
# File 'uu_os_gvc-0.28.16/lib/uu/os/gvc/table.rb', line 95 def number_of_rows rows.size end |