Class: MotionPrime::DateFieldSection

Inherits:
BaseFieldSection show all
Defined in:
motion-prime/sections/form/date_field_section.rb

Constant Summary

Constants inherited from Section

Section::DEFAULT_CONTENT_HEIGHT, Section::KEYBOARD_HEIGHT_LANDSCAPE, Section::KEYBOARD_HEIGHT_PORTRAIT

Instance Attribute Summary

Attributes inherited from BaseFieldSection

#form

Attributes included from CellSectionMixin

#collection_section, #pending_display

Attributes inherited from Section

#elements, #model, #name, #options, #screen, #section_styles

Attributes included from DrawSectionMixin

#cached_draw_image, #container_element, #container_gesture_recognizers

Instance Method Summary collapse

Methods inherited from BaseFieldSection

#all_errors, #bind_text_input, #blur, #clear_observers, #container_height, #default_label_options, #errors_observer_fields, #focus, #form_name, #has_errors?, #observe_model_errors, #observing_errors?, #observing_errors_for, #on_section_render, #prepare_table_data, #reload_section, #render_element?, #style_suffixes

Methods included from CellSectionMixin

#cell, #cell_section_name, #cell_type, #container_bounds, #display, #init_container_element, #pending_display!, #render_container, #section_styles, #table

Methods inherited from Section

#add_element, after_element_render, #after_element_render, after_initialize, after_render, before_initialize, before_render, bind_keyboard_close, #bind_keyboard_events, #bring_to_front, container, #container_bounds, #container_height, #container_options, #create_elements, #current_input_view_height, #default_name, element, #element, #elements_options, #elements_to_draw, #elements_to_render, #hard_reload_section, #has_container_bounds?, #hide, #hide_keyboard, inherited, #initialize, #keyboard_will_hide, #keyboard_will_show, #on_keyboard_hide, #on_keyboard_show, #reload, #render, #render!, #render_container, #render_element?, #screen?, #show, #strong_references, #view

Methods included from DelegateMixin

#clear_delegated, #delegated_by

Methods included from DrawSectionMixin

#after_element_render, #before_element_render, #bind_gesture_on_container_for, #clear_gesture_for_receiver, #draw_in, #prerender_elements_for_state, #prerender_enabled?

Methods included from SectionWithContainerMixin

#container_view, #init_container_element, #load_container_with_elements

Methods included from FrameCalculatorMixin

#calculate_frame_for

Methods included from HasStyles

#prepare_gradient

Methods included from HasClassFactory

#camelize_factory, #class_factory, #low_camelize_factory, #underscore_factory

Methods included from HasNormalizer

#debug_info, #element?, #normalize_object, #normalize_options, #normalize_value

Methods included from HasAuthorization

#api_client, #current_user, #reset_current_user, #user_signed_in?

Constructor Details

This class inherits a constructor from MotionPrime::Section

Instance Method Details

#bind_inputObject



13
14
15
16
17
18
19
20
21
22
# File 'motion-prime/sections/form/date_field_section.rb', line 13

def bind_input
  picker = view(:input)
  picker.setDelegate form
  unless picker.date
    picker.setDate NSDate.date, animated: true
  end
  picker.on :change do
    form.send(options[:action]) if options[:action]
  end
end

#deallocObject



32
33
34
35
36
# File 'motion-prime/sections/form/date_field_section.rb', line 32

def dealloc
  picker = view(:input)
  picker.setDelegate nil
  super
end

#input?Boolean

Returns:

  • (Boolean)


28
29
30
# File 'motion-prime/sections/form/date_field_section.rb', line 28

def input?
  true
end

#valueObject



24
25
26
# File 'motion-prime/sections/form/date_field_section.rb', line 24

def value
  view(:input).date
end