S
S
semki0962016-05-20 11:26:45
PHP
semki096, 2016-05-20 11:26:45

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

1 answer(s)
M
Maxim Fedorov, 2016-05-20
@semki096

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 question

Ask a Question

731 491 924 answers to any question