Question

I'm using jquery UI drag-and-drop. It is possible to refresh the div contents when a draggable div element been dropped?

Please see my example code in the jsFddle . For example, I want the shopping div content could refresh automatically(the content could written by PHP) when dropped. What should I do?

Thanks in advance!

Was it helpful?

Solution

The sortable has a few events that you can use.

I have updated the demo to show using the sortable update event to trigger a function which can be used to update the shopping cart portlet. My demo just changes the text inside the div with the current time however you would need to make an ajax call to get the new content or similar.

OTHER TIPS

Sortable does have a stop event...

            $( "#sortable" ).sortable({
        stop: function(event, ui) {
                //Do what you want to here after the element has been dropped.
            }
    });

Is this what you were looking for?

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top