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

Drag and drop reordering of lists [$25] #943

Closed
chrisnharvey opened this issue Feb 12, 2015 · 23 comments
Closed

Drag and drop reordering of lists [$25] #943

chrisnharvey opened this issue Feb 12, 2015 · 23 comments
Assignees

Comments

@chrisnharvey
Copy link
Contributor

It would be great if it was possible to enable the ability to reorder lists in the backend using drag and drop.

It would also be great if this worked within relation lists too.

Is this a planned feature? If not, is this something you'd be happy me adding via a PR?

@chrisnharvey
Copy link
Contributor Author

I'm about to start work on this. I'll keep this thread updated.

If anyone has any suggestions on how this should work then please let me know.

@daftspunk
Copy link
Member

Please hold off on this, it is a planned feature.

@daftspunk daftspunk self-assigned this Feb 21, 2015
@chrisnharvey
Copy link
Contributor Author

Nice one, I'll leave it to you guys then.

@manogi
Copy link
Contributor

manogi commented May 4, 2015

Is this coming soon? I would have to write my own otherwise anyway, because there is a time issue on my side of things...

@MatissJanis
Copy link
Contributor

It would be amazing to have this one implemented. Currently I've seen some plugins using their own versions of drag&drop sorting.

@CptMeatball
Copy link
Contributor

Is there any update on this? Would be an awesome feature!

@pvullioud
Copy link
Member

Yes, this could be very usefull to standardise the way to manage order with drag&drop

@daftspunk daftspunk changed the title Drag and drop reordering of lists Drag and drop reordering of lists [$10] Jul 3, 2015
@NemoD503
Copy link
Contributor

NemoD503 commented Jul 6, 2015

+1 for this feature

@TheServat
Copy link
Contributor

+1

@that0n3guy
Copy link
Contributor

Whats the $10 bounty thing? My company will pay that right now.

@daftspunk
Copy link
Member

It means someone has put up $10 to see this happen

@tsioukas
Copy link

Also it would be good to be compatible with showTree option of lists. Sometimes it's good to have grouped rows.

This project provides a good example of drag/drop lists/tables. Also it have a powerful API to control almost everything. http://johnny.github.io/jquery-sortable

@daftspunk daftspunk changed the title Drag and drop reordering of lists [$10] Drag and drop reordering of lists [$25] Jul 17, 2015
@jonpxpx
Copy link

jonpxpx commented Jul 17, 2015

@daftspunk let me know where I need to paypal, this USD or AUD?

@jonpxpx
Copy link

jonpxpx commented Jul 17, 2015

And ignore me, turns out I didnt see the link before posting... 👍

@manogi
Copy link
Contributor

manogi commented Jul 17, 2015

I think this needs explaining - at least to me it did ;-)
The bounty means that (at this point) two people have agreed to pay money if someone solves this.
It does not mean that you pay (at this point) $ 25 and @daftspunk or someone else solves this right away...

@jakobfdev
Copy link
Contributor

+1
I am willing to look into this, but I'm not sure where to start. The feature might somehow be integrated into the list behaviour I guess.

How would you guys imagine this reordering thing to work? The Sortable trait from the core defines the logic for saving a sort_oder (or any other column name) of type integer to the database. One would just have to setup the model and database accordingly. But I'm not sure if this helps, since the usual configuration stuff regarding list behaviour is managed via the models yaml files or the controller yaml configs. But the trait cannot be added on runtime, so this has to be implemented differently I guess.

Anyway, two quenstions I've run into:

In case of a list of all model items, this is pretty straight forward, i.e. we could rearrange the list via drag&drop and save all items' sort_order to the database, giving each item a unique integer.
But if we want it to work in different contexts like a relation list (where not all items [e.g. only related] are listed), would we just set new order numbers for the current set of items?

And also how should this work in regard to the sortable functions from the columns.yaml of the model that defines how the list widget handles sorting. Would it make sense to either make automatic sorting possible, as it's defined right now or to restrict everything to manual sorting?

Any ideas?

[EDIT]
Of course this can also easily be done by an additional backend controller action like in the forum plugin, but the code would have to be generated automatically (by artisan?) and activated via the toolbar/yaml-configs (not sure if this covers the related-list-case) to make it convenient to use.
Maybe that's a solution...

@clone45
Copy link

clone45 commented Aug 11, 2015

+1

@tsioukas
Copy link

Is there any documentation for this new feature, or if not do you have it in your todo list?

@hybridvision
Copy link

@tsioukas
Copy link

Thanks, I was looking on Lists, I thought that Sorting Records was from older release :). Maybe a different title will be better.

@hybridvision
Copy link

Maybe it could be called "reordering" instead of "sorting" but in the case of documentation for new features, a good place to check is the documentation repository: https://github.com/octobercms/docs/commits/master

@tdolph
Copy link

tdolph commented Nov 22, 2017

How can i user reorder functionality with relaton manager?

@CptMeatball
Copy link
Contributor

CptMeatball commented Nov 22, 2017

Haven't tried any of these, but maybe look at one of these:

https://github.com/scottbedard/draganddrop
http://octobercms.com/forum/post/reordering-items-in-a-relation#post-13983

You can also perform a queryFilter on the reorder view. For this you need to add the id for the relation to the reorder controllerview.

So your URL would besomething like: /acme/relationcontroller/reorder/{id}. And in your controller you would add a filter on the reorder view to only load the relationship models. I think you need a seperate controller for this. That's tied to the relation models. Add a reorder button to the relation manager which goes to mentioned URL.

PS: This is not the place to ask these kind of questions. You should better look at the forums or ask it on the OctoberCMS Slack :)

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

No branches or pull requests