In my database, I have a table of items, sorted by a numeric "position" column. Each position is unique, and they define how the data is displayed (1 is displayed first, and 10 is displayed last, for example).
I'm trying to write out a controller that allows me to do two key things:
Firstly, I need to be able to move any item up one place or down one place (obviously if it's at the beginning or end already, it can't be moved up or down, respectively).
Secondly, I would like to be able to reorder the items using a drag and drop interface. I've found such interfaces, but I don't know how to use one.
If you've ever successfully implemented a reordering feature for a table, whether it uses drag and drop or "up" and "down" buttons, please help me! This is proving very, very complicated, and yet it's very important to my website. I'm not exactly a newbie to Laravel, it's just I underestimated how hard it was to do this!
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire