motion-prime/sections/form.rb in motion-prime-0.4.5 vs motion-prime/sections/form.rb in motion-prime-0.5.0
- old
+ new
@@ -153,11 +153,11 @@
end
end
def load_field(field)
field_class = class_factory("#{field[:type]}_field_section", true)
- field_class.new(field.merge(screen: screen, table: self))
+ field_class.new(field.merge(screen: screen, table: self.weak_ref))
end
def render_field?(name, options)
return true unless condition = options[:if]
if condition.is_a?(Proc)
@@ -205,9 +205,15 @@
end
def height_for_index(table, index)
section = load_cell_by_index(index, preload: false)
section.container_height
+ end
+
+ def events_off
+ fields.values.each do |section|
+ section.events_off
+ end
end
class << self
def field(name, options = {}, &block)
options[:name] = name
\ No newline at end of file