Class: Netzke::Communitypack::LiveSearchGridPanel

Inherits:
Basepack::GridPanel
  • Object
show all
Defined in:
lib/netzke/communitypack/live_search_grid_panel.rb

Overview

The LiveSearchGridPanel provides a search field in the toolbar of the GridPanel. While the content of the search field is changeing, the data in the grid gets reloaded and the filter string is given to a scope on the configured model. The scope name by default is :live_search but it can be reconfigured by the configuration option :live_search_scope.

Options:

  • live_search_scope - The scope name for filtering the results by the live search (default: :live_search)

Instance Method Summary collapse

Instance Method Details

#get_data(*args) ⇒ Object



38
39
40
41
42
43
44
# File 'lib/netzke/communitypack/live_search_grid_panel.rb', line 38

def get_data(*args)
	params = args.first
	search_scope = config[:live_search_scope] || :live_search
	data_class.send(search_scope, params && params[:live_search] || '').scoping do
		super
	end
end