jbox-web/ajax-datatables-rails

Rework how columns are declared

Closed this issue · 1 comments

Recently a decision was made to add support for empty arrays in the sortable_columns and searchable_columns methods, as proposed here: #81

But it has been brought up recently through this issue: #83 that perhaps a better approach to how columns are declared is the best thing to do.

Proposed behavior:

  • replace sortable_columns and searchable_columns methods with only one method named view_columns which will hold the same columns displayed in the html view, but expressed in ModelName.column_name, AliasedJoinTableName.column_name notation.
  • then the gem should identify the corresponding column to sort by or search on based on the sortable and searchable properties for each column coming through the view params.

Completed.