Skip to content

Latest commit

 

History

History
105 lines (74 loc) · 3.05 KB

CHANGELOG.md

File metadata and controls

105 lines (74 loc) · 3.05 KB

Changelog

[2.0.1]

  • Fixed search field type support #330
class UsersGrid < Datagrid::Base
  scope  { User }

  filter(
    :query, :string, input_options: { type: "search" }
  ) do |value, scope|
    scope.magic_search(value)
  end
end

Renders filter as:

<input type="search" name="users_grid[query]" id="users_grid_query"/>
  • Added support for default_filter_options and added lambda support for default_column_options #333 by @tmikoss.
class UsersGrid < Datagrid::Base
  scope { User }

  self.default_column_options = -> (column) {
    {header: I18n.t("datagrid.keywords.#{column.name}")}
  }

  self.default_filter_options = -> (filter) {
    {
      header: I18n.t("datagrid.keywords.user.#{filter.name}"),
      input_options: filter.type == :string ? {type: "textarea"} : {},
    }
  }
  
  filter(:first_name, :string)
  filter(:last_name, :string)

  column(:first_name)
  column(:last_name)
end

[2.0.0]

Version 2 is a major update implementing a lot of major improvements at the cost of backward compatibility.

Changes and migration guide

[1.8.3]

  • Fix rails hooking for version 7.1. #327
  • Fix formatting of value for date and datetime-local input types

[1.8.2]

  • Treat true/false as YES/NO when assigned as strings for xboolean filter.
  • Support infinite ranges for date, datetime and integer filters.
  • Treat ActiveRecord::Result class as Array driver.
  • Add Datagrid#reset method to reset a column cache.
  • Drop support of Rails 6.0 #326

[1.8.1]

  • Prioritize input_options over generated by default. #319

[1.8.0]

  • Support input_options: {type: "textarea"} as <textarea/> tag
  • Remove deprecated eboolean filter
  • Fixed scope wrapping to be universal
  • Deprecated integer_range_filters and date_range_filters. Use filter(name, type, range: true) instead.
  • Add original_scope method that returns scope as it was defined without any wrapping #313
  • Add ability to specify columns option for datagrid_row. #314

[1.7.0]

  • Depend on railties instead of rails to prevent loading of unnecessary frameworks
  • Bugfix File.exist? usage for Ruby 3.0 #307
  • Drop support of old Ruby versions (< 2.7) #305
  • Drop support of old Rails versions (< 6.0) #305

[1.6.3]

  • Fix usage of options spread operator for Ruby 3.0 #296

[1.6.2]

  • Add input_options and label_options to filter method #294
  • Fix <option> tag rendering for Rails 6.0

1.6.1 and before

Changes are not tracked