motion-prime/sections/form.rb in motion-prime-0.4.2 vs motion-prime/sections/form.rb in motion-prime-0.4.3
- old
+ new
@@ -52,18 +52,10 @@
dataSource: self,
style: (UITableViewStyleGrouped unless flat_data?)}
self.table_element = screen.table_view(options)
end
- def render_cell(index, table)
- field = rows_for_section(index.section)[index.row]
- screen.table_view_cell section: field, reuse_identifier: cell_name(table, index), parent_view: table_view do |container_view, container_element|
- field.container_element = container_element
- field.render
- end
- end
-
def reload_cell(section)
field = section.name.to_sym
index = field_indexes[field].split('_').map(&:to_i)
path = NSIndexPath.indexPathForRow(index.last, inSection: index.first)
section.cell.try(:removeFromSuperview)
@@ -216,11 +208,11 @@
target.text.length < limit
end
end
def load_field(field)
- klass = "MotionPrime::#{field[:type].classify}FieldSection".constantize
- klass.new(field.merge(screen: screen, table: self))
+ field_class = class_factory("#{field[:type]}_field_section", true)
+ field_class.new(field.merge(screen: screen, table: self))
end
def render_field?(name, options)
return true unless condition = options[:if]
if condition.is_a?(Proc)
\ No newline at end of file