Skip to content

Commit

Permalink
Merge pull request #813 from infinitered/bugfix/issue-811
Browse files Browse the repository at this point in the history
Allows access to search_string in searchable table views
  • Loading branch information
andrewhavens authored Oct 24, 2018
2 parents 736a7c3 + d4dded1 commit fad2d7e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/ProMotion/table/data/table_data.rb
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,13 @@ def filtered?
@filtered == true
end

def search_string
@search_string ||= nil
end

def search(search_string)
@filtered = true
@search_string = search_string
self.filtered_data = []

self.data.compact.each do |section|
Expand Down
4 changes: 4 additions & 0 deletions lib/ProMotion/table/table.rb
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,10 @@ def searching?
self.promotion_table_data.filtered?
end

def search_string
self.promotion_table_data.search_string
end

def update_table_view_data(data, args = {})
self.promotion_table_data.data = data
if args[:index_paths]
Expand Down

0 comments on commit fad2d7e

Please sign in to comment.