smartmetals / phoenix_datatables

Library to implement server-side API for the jQuery DataTables library with Elixir and Phoenix Framework
MIT License
14 stars 7 forks source link

Add support for sorting NULLS LAST #21

Closed devshane closed 5 years ago

devshane commented 5 years ago

This adds a nulls_last option to fetch_datatable. When nulls_last is true and the sort direction is descending, results will be sorted with NULLs following non-NULL data. This option is only valid with PostgreSQL.

The example site uses nulls_last: true as a default now.

There's an existing issue with the example site that allows you to add Item records, but doesn't set category_id or unit_id so they don't display in the table without manual edits. This PR doesn't address that issue.

Re: #20

jeremyjh commented 5 years ago

Looks great, thanks!

devshane commented 5 years ago

👍 Thanks for the help getting this done. Will you be pushing a release to Hex?

jeremyjh commented 5 years ago

Pushed to Hex as 0.4.0.