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

Adding ability to sort by columns #33

Closed nathanjohnson320 closed 3 years ago

nathanjohnson320 commented 3 years ago

Adds the ability to sort individual columns coming in from the client.

This was already being parsed properly the only addition was the def search_columns(queryable, params, options \\ []) do to query.ex. Also added a macro that allows to search columns based on and.

The reason for that being if you search something in multiple columns the likely case is you are trying to filter all the rows based on each filter, not return rows that do not match the collective filters.

All the other changes are from running mix format

jeremyjh commented 3 years ago

Can we add a test? There are tests in this lib but most of the tests are in the example project.

jeremyjh commented 3 years ago

Can you bump the version number as well? It looks like this should not be a breaking change so we can just bump the revision. I will add you to the hex project so you can publish it after merging and labelling.