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-14.3.0 app/components/marty/live_search_grid_panel.rb
marty-14.0.0 app/components/marty/live_search_grid_panel.rb
marty-13.0.2 app/components/marty/live_search_grid_panel.rb
marty-11.0.0 app/components/marty/live_search_grid_panel.rb
marty-10.0.3 app/components/marty/live_search_grid_panel.rb
marty-10.0.2 app/components/marty/live_search_grid_panel.rb
marty-10.0.0 app/components/marty/live_search_grid_panel.rb
marty-9.5.1 app/components/marty/live_search_grid_panel.rb
marty-9.5.0 app/components/marty/live_search_grid_panel.rb
marty-9.3.3 app/components/marty/live_search_grid_panel.rb
marty-9.3.2 app/components/marty/live_search_grid_panel.rb
marty-9.3.0 app/components/marty/live_search_grid_panel.rb
marty-8.5.0 app/components/marty/live_search_grid_panel.rb
marty-8.4.1 app/components/marty/live_search_grid_panel.rb
marty-8.3.1 app/components/marty/live_search_grid_panel.rb
marty-8.2.0 app/components/marty/live_search_grid_panel.rb
marty-8.0.0 app/components/marty/live_search_grid_panel.rb
marty-6.1.0 app/components/marty/live_search_grid_panel.rb
marty-5.2.0 app/components/marty/live_search_grid_panel.rb
marty-5.1.4 app/components/marty/live_search_grid_panel.rb