Module: Datagrid::ColumnNamesAttribute::ClassMethods

Defined in:
lib/datagrid/column_names_attribute.rb

Instance Method Summary collapse

Instance Method Details

#column_names_filter(options = {}) ⇒ Object

Adds a filter that acts like a column selection All defined columns will be available to select/deselect as a multi-select enum filter. Columns with :mandatory => true option will always present in the grid table and won't be listed in column names selection Accepts same options as :enum filter

Examples:

column_names_filter(:header => "Choose columns")

29
30
31
32
33
34
35
# File 'lib/datagrid/column_names_attribute.rb', line 29

def column_names_filter(options = {})
  filter(:column_names, :enum, {
    :select => :optional_columns_select,
    :multiple => true,
    :dummy => true
  }.merge(options || {}))
end