Answer the question
In order to leave comments, you need to log in
How to add to the database on the "drag and drop" event of the sortable plugin?
https://github.com/RubaXa/Sortable I use this plugin. In the left bar - a block that is cloned and dragged to the right bar. On this event, I need to add this new cloned block to the database. I understand that this is done by Ajax. But as I understand it, it is necessary to somehow register this event here, help me understand how to do this.
Answer the question
In order to leave comments, you need to log in
well, judging by the documentation, you can use callback on onEnd to send jax
// dragging ended
onEnd: function (/**Event*/evt) {
evt.oldIndex; // element's old index within parent
evt.newIndex; // element's new index within parent
},
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question