- allow batch actions to return files, data or redirects
- define default order by giving
default_order: '<sql order>'
option totabulatr_for
- Rename
filter
option oftable_for
tofilters
to not conceal thetable_option
also namedfilter
.
-
Add
filter
to DSL to define custom filtersExample:
filter :product_price_range do |relation, value| relation = relation.joins(:products) if value == 'low' relation.group("vendors.id").having('AVG(products.price) <= 100') elsif value == 'high' relation.group("vendors.id").having('AVG(products.price) > 100') end end
-
Add
current_user
local to Tabulatr::Data by default if available and not already present
-
If a batch action is executed without checking any rows it will be applied to all rows in the current filter
-
Add filter
enum_multiselect
Example:
column :status, filter: :enum_multiselect
Adds paginate
as config option
-
Adds filter support for
enum
If it detects an enum it creates a dropdown filter with the possible enum values as options.fixes #35
-
Removes bootstrap2 CSS modifications
-
Adds localStorage persistency for tables. It's automatically turned on for paginated tables and you can adjust the setting in your template.
Example:
table_for Product, persistent: false
-
Added
font-awesome-rails
-
The DSL now accepts a search block with two block variables. The second being the relation. The block needs to return an ActiveRecord::Relation, a Hash, a String, nil or an Array.
Example:
search do |query, relation| relation.joins(:vendor).where(["vendors.name = ?", query]) end
- Better DOM scopes to enable working with multiple tables per page
- Added
pagination_position
option totable_for
. Possible values are:top
,:bottom
and:both
. - Add 'mark all' checkbox in header row again
- Added
html_class
option totable_for
-
Fixed date filters
-
Added missing translations to the install generator.
-
Tabulatr is now stopped from retrieving data in endless pagination mode when all data is already on the client.
-
Automatically determine appropriate filter types for the columns
-
Boolean filter is now a
select
field withyes
,no
,both
options -
User can pass in additional variables to the TabulatrData-Class via the
locals
argument.
Example:
tabulatr_for Product, locals: {current_user: current_user}
- Fixed bug which caused a reload of the website when clicking on the current table page again.
-
Show spinner when data is loading. Type of spinner can be overriden via
Tabulatr.spinner
option. Possible values are :standard and :pacman.Example:
Tabulatr.config do |tc| tc.spinner = :pacman end
-
does not complain when no id is manually provided in TabulatrData
-
Added
row
to the TabulatrData DSL to provide HTML attributes for the table_row of each record.Example:
row do |record, row_config| if record.super_important? row_config[:class] = 'important'; end row_config[:data] = { href: edit_user_path(record.id), vip: record.super_important? } end
-
Added
id
of record asdata-id
of table row in static table if id is available. -
Added
columns
keyword argument totable_for
-
Added
checkbox
to the TabulatrData DSL
- fix sorting, filtering, searching and batch_actions for tables whose class is camelCased.
-
new Generator:
tabulatr:install
- now only for creating I18n filetabulatr:table MODEL
- for creating MODELTabulatrData class -
get rid of
bootstrap_paginator
option and initializer -
get rid of
security_tokens
-
fixed bug in association call
-
support namespaced rails models
- Added
order_by
option totable_for
for default sorting.
-
New table_column_options
cell_style
andheader_style
Example:column :name, cell_style: {:'background-color' => 'red'}, header_style: {:'font-weight' => 'bold'}
-
Added
classes
attribute totable_column_options
. Example:column :foobar, table_column_options: {classes: "mycssclass foobar-column"}
-
Fixed prefiltering. Example:
tabulatr_for(Product.where(price: 10))