Module: AjaxDatatablesRails::Datatable::Column::Order
- Included in:
- AjaxDatatablesRails::Datatable::Column
- Defined in:
- lib/ajax-datatables-rails/datatable/column/order.rb
Instance Method Summary collapse
-
#nulls_last? ⇒ Boolean
Add option to sort null values last.
- #orderable? ⇒ Boolean
-
#sort_field ⇒ Object
Add sort_field option to allow overriding of sort field.
- #sort_query ⇒ Object
Instance Method Details
#nulls_last? ⇒ Boolean
Add option to sort null values last
22 23 24 |
# File 'lib/ajax-datatables-rails/datatable/column/order.rb', line 22 def nulls_last? @view_column.fetch(:nulls_last, false) end |
#orderable? ⇒ Boolean
8 9 10 |
# File 'lib/ajax-datatables-rails/datatable/column/order.rb', line 8 def orderable? @view_column.fetch(:orderable, true) end |
#sort_field ⇒ Object
Add sort_field option to allow overriding of sort field
13 14 15 |
# File 'lib/ajax-datatables-rails/datatable/column/order.rb', line 13 def sort_field @view_column.fetch(:sort_field, field) end |
#sort_query ⇒ Object
17 18 19 |
# File 'lib/ajax-datatables-rails/datatable/column/order.rb', line 17 def sort_query custom_field? ? source : "#{table.name}.#{sort_field}" end |