Class: MeiMultiLookupInput
- Inherits:
-
MultiValueInput
- Object
- MultiValueInput
- MeiMultiLookupInput
- Defined in:
- app/inputs/mei_multi_lookup_input.rb
Direct Known Subclasses
Instance Method Summary collapse
-
#build_field_options(value, index) ⇒ Object
Although the ‘index’ parameter is not used in this implementation it is useful in an an overridden version of this method, especially when the field is a complex object and the override defines nested fields.
- #inner_wrapper ⇒ Object
-
#input_type ⇒ Object
Overriding this so that the class is correct and the javascript for multivalue will work on this.
Instance Method Details
#build_field_options(value, index) ⇒ Object
Although the ‘index’ parameter is not used in this implementation it is useful in an an overridden version of this method, especially when the field is a complex object and the override defines nested fields.
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
# File 'app/inputs/mei_multi_lookup_input.rb', line 21 def (value, index) = .dup [:value] = value if @rendered_first_element [:id] = nil [:required] = nil else [:id] ||= input_dom_id end [:class] ||= [] [:class] += ["#{input_dom_id} form-control multi-text-field"] [:style] ||= [] [:style] += ["width:80%"] [:'aria-labelledby'] = label_id @rendered_first_element = true end |
#inner_wrapper ⇒ Object
7 8 9 10 11 12 13 14 15 16 |
# File 'app/inputs/mei_multi_lookup_input.rb', line 7 def inner_wrapper " <li class=\"field-wrapper\">\n<div class=\"input-group col-sm-12\">\n \#{yield}\n <button style=\"width:auto;\" type=\"button\" class=\"btn btn-default\" data-toggle=\"modal\" data-target=\"#meiLookupModal_\#{attribute_name}\">Lookup</button>\n</div>\n </li>\n HTML\nend\n" |
#input_type ⇒ Object
Overriding this so that the class is correct and the javascript for multivalue will work on this.
3 4 5 |
# File 'app/inputs/mei_multi_lookup_input.rb', line 3 def input_type 'multi_value'.freeze end |