Skip to content
Advertisement

jQuery UI sortable images

Hi I ‘d like some help please, as my skills in jQuery are not so good. What I want to achieve is to change the order of the images like this example.

My database looks like this:

JavaScript

I have also created these 2 views: index.php

JavaScript

order_ajax.php

JavaScript

I have also created and the order_ajax controller

JavaScript

So what I basically want to do is to drag the images around in order to change their order, and when I click the save button pass the (new) data/order to the controller and to store them in the database. How can I make this work?

Advertisement

Answer

Well, the solution was more simple than I thought.

On the index.php view I’ve put this

JavaScript

and this is the controller function

JavaScript
User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement