zorab47 / active_admin-sortable_tree

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

Filters broken when using gem #6

Closed mdoyle13 closed 11 years ago

mdoyle13 commented 11 years ago

Hey sorry to keep reporting issues - but I am unable to use active admin filters when implementing your gem. All records show up regardless of what filter is selected. Here's some code.

When i revert back to stock the stock index view the filters work as they should.

ActiveAdmin.register AssetCollection do  
  filter :brand, :collection => Brand.all.map{|b| ["#{b.name} #{b.business_unit.name}", b.id]}           

  sortable
  sortable tree: true,
             sorting_attribute: :position

  index :as => :sortable do
    label :name
    default_actions
   end

.......

end
nebirhos commented 11 years ago

That's not a bug, filters shouldn't exist on the tree view, because otherwise you could update only a subset of children and break the whole tree structure. Maybe it could be possible to filter only root nodes, take a look at https://github.com/nebirhos/activeadmin-sortable-tree/blob/master/lib/active_admin/views/index_as_sortable.rb#L10

mdoyle13 commented 11 years ago

Makes sense. Thanks.

scarroll32 commented 4 years ago

Would be good to be able to filter by a branch, for larger trees.