motion-prime/sections/form.rb in motion-prime-0.9.8 vs motion-prime/sections/form.rb in motion-prime-0.9.9

- old
+ new

@@ -28,24 +28,23 @@ fields.values end end def hard_reload_cell_section(section) - field = section.name.to_sym - path = field_indexes[field] - section.cell.try(:removeFromSuperview) + field_name = section.name.to_sym + path = field_indexes[field_name] + deque_cell(section, at: path) # deque cached - fields[field] = load_field(self.class.fields_options[field]) - fields[field].create_elements + fields[field_name] = load_field(self.class.fields_options[field_name]) + fields[field_name].create_elements if flat_data? - @data[path.row] = fields[field] + @data[path.row] = fields[field_name] else - @data[path.section][path.row] = fields[field] + @data[path.section][path.row] = fields[field_name] end - set_data_stamp(fields[field].object_id) - table_view.reloadRowsAtIndexPaths([path], withRowAnimation: UITableViewRowAnimationNone) + self.performSelectorOnMainThread(:reload_cells, withObject: path, waitUntilDone: false) end # Returns element based on field name and element name # # Examples: @@ -199,10 +198,10 @@ end # Table View Delegate # --------------------- - def number_of_groups(table = nil) + def number_of_groups has_many_sections? ? grouped_data.reject(&:nil?).count : 1 end class << self def inherited(subclass) \ No newline at end of file