You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Updated `order` and `order_desc` options to accept `Proc` for dynamic ordering logic.
- Improved `if` and `unless` options to accept `Symbol` or `Proc` for conditional column availability.
- Enhanced documentation for better clarity on usage and examples.
# @param block [Block] proc to calculate a column value
266
266
# @option options [Boolean, String] html Determines if the column should be present
267
267
# in the HTML table and how it is formatted.
268
-
# @option options [String, Array<Symbol>] order Determines if the column can be sortable and
268
+
# @option options [String, Array<Symbol>, Proc] order Determines if the column can be sortable and
269
269
# specifies the ORM ordering method.
270
270
# Example: `"created_at, id"` for ActiveRecord, `[:created_at, :id]` for Mongoid.
271
-
# @option options [String] order_desc Specifies a descending order for the column
272
-
# (used when `:order` cannot be easily reversed by the ORM).
271
+
# Can be a Proc accepting a scope argument and returning a scope with applied order
272
+
# @option options [String, Array<Symbol>, Proc] order_desc Specifies a descending order for the column.
273
+
# See `order` option for context.
274
+
# Used when `:order` cannot be easily reversed by the ORM.
273
275
# @option options [Boolean, Proc] order_by_value Enables Ruby-level ordering for the column.
274
276
# Warning: Sorting large datasets in Ruby is not recommended.
275
277
# If `true`, Datagrid orders by the column value.
276
278
# If a block is provided, Datagrid orders by the block's return value.
277
279
# @option options [Boolean] mandatory If `true`, the column will never be hidden by the `#column_names` selection.
278
280
# @option options [Symbol] before Places the column before the specified column when determining order.
279
281
# @option options [Symbol] after Places the column after the specified column when determining order.
280
-
# @option options [Boolean, Proc] if conditions when a column is available.
281
-
# @option options [Boolean, Proc] unless conditions when a column is not available.
282
+
# @option options [Symbol, Proc] if conditions when a column is available, can be a method name or a proc with grid argument returning `Boolean`.
283
+
# @option options [Symbol, Proc] unless conditions when a column is not available, can be a method name or a proc with grid argument returning `Boolean`.
0 commit comments