Sha256: 8e7c3e1f3ec24e642e4f996da3a720ad7b1a412a00dcc731d67af2fc5af4cfa2

Contents?: true

Size: 939 Bytes

Versions: 56

Compression:

Stored size: 939 Bytes

Contents

# 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.  NOTE: this is rewrite of the Netzke community
# pack component of the same name.  We should submit this to the
# community.
#
# Options:
# * +live_search_scope+ - The scope name for filtering the results by
#   the live search (default: :live_search)
#

class Marty::LiveSearchGridPanel < Marty::McflyGridPanel
  client_class do |c|
    c.include :live_search_grid_panel
  end

  def get_records(params)
    search_scope = config[:live_search_scope] || :live_search
    model.send(search_scope, params && params[:live_search] || '').scoping do
      super
    end
  end
end

Version data entries

56 entries across 56 versions & 1 rubygems

Version Path
marty-5.1.3 app/components/marty/live_search_grid_panel.rb
marty-5.1.2 app/components/marty/live_search_grid_panel.rb
marty-5.1.1 app/components/marty/live_search_grid_panel.rb
marty-5.1.0 app/components/marty/live_search_grid_panel.rb
marty-3.1.0 app/components/marty/live_search_grid_panel.rb
marty-3.0.1 app/components/marty/live_search_grid_panel.rb
marty-4.0.0.rc2 app/components/marty/live_search_grid_panel.rb
marty-3.0.0 app/components/marty/live_search_grid_panel.rb
marty-2.9.3 app/components/marty/live_search_grid_panel.rb
marty-2.9.2 app/components/marty/live_search_grid_panel.rb
marty-2.9.1 app/components/marty/live_search_grid_panel.rb
marty-2.8.0 app/components/marty/live_search_grid_panel.rb
marty-2.7.3 app/components/marty/live_search_grid_panel.rb
marty-2.7.2 app/components/marty/live_search_grid_panel.rb
marty-2.7.1 app/components/marty/live_search_grid_panel.rb
marty-2.7.0 app/components/marty/live_search_grid_panel.rb
marty-2.6.8 app/components/marty/live_search_grid_panel.rb
marty-2.6.7 app/components/marty/live_search_grid_panel.rb
marty-2.6.6 app/components/marty/live_search_grid_panel.rb
marty-2.6.5 app/components/marty/live_search_grid_panel.rb