zorab47 / active_admin-sortable_tree

Show ActiveAdmin index as a nested tree with drag'n'drop
MIT License
162 stars 127 forks source link

Add option to disable sorting #41

Closed alewando closed 9 years ago

alewando commented 9 years ago

Adds option 'sortable' (default: true) that can be used to disable drag-and-drop sorting. A use case for this is when you want the collapsable tree behavior, but do not want to allow sorting.

zorab47 commented 9 years ago

Great idea! Now that I think of it, it seemed to be a missing feature. :+1:

Does this allow sorting be conditionally disabled at run time? Think of the case where a user doesn't have permission to resort a set of records.

alewando commented 9 years ago

I added support for using a Proc for the 'sortable' option.

zorab47 commented 9 years ago

Great stuff.. I integrated it into my branch: active_admin-sortable_tree. I decided to completely disable the Javascript when sorting isn't available.

zorab47 commented 9 years ago

I ended up going in a different direction, but it is now possible to completely disable sorting. Thanks again for the idea and PR!!