lib/ProMotion/table/table.rb in ProMotion-1.0.2 vs lib/ProMotion/table/table.rb in ProMotion-1.0.3
- old
+ new
@@ -29,10 +29,13 @@
def check_table_data
PM.logger.error "Missing #table_data method in TableScreen #{self.class.to_s}." unless self.respond_to?(:table_data)
end
def set_up_table_view
+ # before access self.table_data, create UITableView and call on_load
+ table_view
+
self.view = self.create_table_view_from_data(self.table_data)
end
def set_up_searchable
if self.class.respond_to?(:get_searchable) && self.class.get_searchable
@@ -57,10 +60,18 @@
def searching?
@promotion_table_data.filtered
end
+ def original_search_string
+ @promotion_table_data.original_search_string
+ end
+
+ def search_string
+ @promotion_table_data.search_string
+ end
+
def update_table_view_data(data)
create_table_view_from_data(data) unless @promotion_table_data
@promotion_table_data.data = data
table_view.reloadData
end
@@ -240,13 +251,13 @@
def deleteRowsAtIndexPaths(index_paths, withRowAnimation:animation)
PM.logger.warn "ProMotion expects you to use 'delete_cell(index_paths, animation)'' instead of 'deleteRowsAtIndexPaths(index_paths, withRowAnimation:animation)'."
delete_row(index_paths, animation)
end
-
+
protected
-
+
def map_row_animation_symbol(symbol)
symbol ||= UITableViewRowAnimationAutomatic
{
automatic: UITableViewRowAnimationAutomatic,
fade: UITableViewRowAnimationFade,
@@ -286,10 +297,10 @@
end
def get_refreshable_params
@refreshable_params ||= nil
end
-
+
# Indexable
def indexable(params = {})
@indexable_params = params
@indexable = true
end