Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: Sorting #146

Open
bumbus opened this issue Jul 24, 2019 · 5 comments
Open

Feature: Sorting #146

bumbus opened this issue Jul 24, 2019 · 5 comments

Comments

@bumbus
Copy link

bumbus commented Jul 24, 2019

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

@robbieaverill
Copy link
Contributor

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.

@bumbus
Copy link
Author

bumbus commented Jul 24, 2019

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.

@robbieaverill
Copy link
Contributor

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.

@obj63mc
Copy link
Contributor

obj63mc commented Aug 20, 2019

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.

@micschk
Copy link
Contributor

micschk commented Dec 16, 2021

+1 this would be a very handy addition

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants