Feature: Sorting
bumbus opened this issue · 5 comments
Hi there,
I would like to know if you are planing to make items sortable through a many_many_extraFields
column?
Thanks for listening
Bumbus
Hi, in SilverStripe 4 extra fields on many many are not versioned, so we would encourage you to use many many through and add your sort field to the “through” model instead, which can be versioned if you’d like it to be.
Thanks for your reply.
Maybe my request was too vague. I just asked myself if drag&drop reordering would not be a nice thing to have.
I think I misread your request. You can sort the list that you pass into tagfield by using a custom method on your DataObject to return it.
While you can sort the dataobject manually in code and inject it into the list of tags that are shown, there is no way to change the sort of your tags when using a tagfield. When using many_many_extrafields or with a through dataobject, when adding a tag - it won't update that 'sort' column nor does the interface provide a way to move the order directly.
So an example is right now you would have to use say a GridField with a GridFieldConfig_RelationEditor config as well as something like UndefinedOffset\SortableGridField which would let you add the relation and then drag/drop the order. What the original request of this was is you should be able to specify the sort column of your tags like with UndefinedOffset\SortableGridField and then have the ability to simply move the order of tags when on the page. Now if drag and drop is too much of a pain, even respecting the order of which they are added/removed to set the sort value would be great too.
+1 this would be a very handy addition