Closed leoliu closed 4 years ago
The production version of FilePond has never had the option to drag files. You can however drop them at a location that you want.
Well that'd be a great plugin to have :) Is this something you're considering on your roadmap?
Meanwhile, is there any way to reverse the default order (i.e. insert new files at the bottom of the list)?
An earlier version of FilePond had it but I removed it to get to 1.0 quicker, will probably add it in the future somewhere if demand grows.
I also need reverse order and it's critical for me. Trying to hack it somehow right now with no luck :(
@kelong I'm currently working on a grid view, which also required rewriting the way files are dropped, I might add sorting to the mix as well.
@rikschennink Great thanks. That would change a lot. How long do you think it would take to do that?
@kelong Can't give time estimate as this is work that is done in between other work
@kelong @clementmas No drag and drop yet but I've added file sorting in version 4.0.0
Hi, when you finish drag and drop file sorting, could you also change hidden input field "filepond" with file ID to an array (<input type="hidden" name="filepond[]" value), or to filepond1 .... filepond100000 :). So it will be easy to write sorting to db on server (now I receive only one variable filepond) Thank you.
@smickar are the files not sorted correctly?
Hi, it is not about sorting, but about that every file hase same hidden input name "filepond". So when I submit form with Filepond I receive only one variable "filepond", even if I have xx files.
@smickar, that's basically how it works at the moment, this is how the PHP boilerplate functions: https://github.com/pqina/filepond-boilerplate-php
Hope to see manual sorting soon
Also hoping to see this feature implemented!
hi @rikschennink, is there any development about drag and drop sorting?
I've developed a tiny prototype but so far haven't had time to work on it further.
Definitely a much-needed feature. Maybe it goes without saying, but it should also be possible to resort existing files, not just newly-uploaded ones.
I did not find any uploader with manual sorting :(
@KilledDebtor I think this one is a good example: https://innostudio.de/fileuploader/examples/sorter/default/
I have written a simple plugin for this: https://github.com/yqlim/filepond-plugin-drag-reorder
It has been tested for ajax submission. It has not been tested with FilePond upload feature however.
Is the prototype code available somewhere? I am also super interested in this feature. I agree with a previous comment that it should apply to existing files (I want to implement a way to manually sort existing + new images and save them with their sequence information). @yqlim solution might do the trick though, I need to test it out. Thank you!
Looking good. Can't wait for the update. I've hacked together a rough drag and drop reordering so it'll be nice to have something cleaner to work with.
First reorder by drag/drop has been added in 4.9.1
.
allowReorder
@rikschennink You made my day ! Really nice, thanks for your work !
@rikschennink Thanks a lot for this update! Is there (or will there be) a Callback for listening to reordering events? Or is there another way to get the order of the files when it changes?
@nusoft That sounds like a good idea. It currently does not trigger any events.
@rikschennink I enabled allowReorder
but it didn't work with me.. I just want to get the order of elements once I submit the form. How would I do that?
Hi @OneMajed I don't understand how this is related to re-order, can you elaborate
Currently, I am sending the images using ajax. What I need to achieve is once I submit the form with the images, I need the images order to be sent to my backend with the same order displayed. How can I receive this ordered list (for example as a json)
Thanks @rikschennink
@OneMajed getFiles
should return the correct order.
Thanks @rikschennink it worked with me
Any plans to support grid reorder. Only works in column mode.
@prince272 https://github.com/pqina/filepond/pull/421
Now available in 4.15.0
I have received a report from a user that a feature disappeared recently. Previously it was possible to drag and re-corder files before uploading them. Now it is not possible any more. Is this intentional?
I have checked the documentation and commit log but could not find anything related to this change.