rvera / image-picker

Image Picker is a simple jQuery plugin that transforms a select element into a more user friendly graphical interface.
http://rvera.github.com/image-picker
Other
906 stars 216 forks source link

Integrate with drag and drop functionality? #36

Closed eappell closed 10 years ago

eappell commented 10 years ago

I am using image-picker to display a grid of images. I would also like to allow the user to re-order the images by dragging and dropping them to swap image position. Has anyone attempted to do this with image-picker? If so, what is the best approach? Not sure if I should re-order the select options or the images and then re-sync with select? Thanks!

rvera commented 10 years ago

Hi Eddie, what are you trying to achieve?

The idea of the plugin is to replace a select element, it seems that what you want goes beyond that to the point where order is importante.

eappell commented 10 years ago

Yeah, I'm trying to use it to generate a user-selected photo gallery. For my purposes, it will be important to allow users to change the order of the photos. However, users don't necessarily have to determine the order of the photos, just have the ability to change the order, so I've implemented a method for shuffling the options in the select, then re-binding to the picker. That allows me to provide a "shuffle" button which randomly sorts the photos on demand. I think that will work for what I need. Just thought I'd check to see if anyone else had implemented drag and drop with this before.

If you or anyone else knows of a plugin that might be more appropriate for my purposes please let me know. Thanks!

rvera commented 10 years ago

As far as I know no one has done this feature before, the idea of this plugin is to make select elements more user friendly, if what you need can't be done with a simple select element then it's probably out of scope.

Your idea of shuffling the the select should work, anything more complicated feels like you need a custom, very specific widget for your page otherwise.

Thanks for the feedback, I love seeing how other people are using it and how to improve it.