Answer the question
In order to leave comments, you need to log in
Is it possible to somehow know in advance how many elements in the list to which the user wants to move the element?
Hello!
There are two lists. Users can move items between lists. I use for this Sortable | jQueryUI . The question is: The user has decided to move an element from list A to list B, but the user has not yet released the element (that is, the stop
event has not fired yet ). Is it possible to somehow know in advance how many elements in the list B to which the user wants to transfer the element? The over
event gives information about how many elements are in the current list (list A) from which the element is transferred:
over: function(event, ui){
console.log($('div[id='+ui.item.attr("id")+']').closest('.list-group').children().length);
},
beforeStop: function(event, ui){
console.log($('div[id='+ui.item.attr("id")+']').closest('.list-group').children().length);
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question