Some time ago I wrote about the fact that you write some
"analog jQuery Treeview". Thanks to the hint
nikitammf problem "otprygivat item" I overcame.
But there was another problem. To describe her, I first explain how the jQuery UI Draggable plugin is determines whether or not the portable element over the droppable element.
At the beginning of the transfer of the seized item the method is called
$.ui.ddmanager.prepareOffsets(this, event)
(line 152 of file /development-bundle/ui/jquery.ui.draggable.js). This method stores in the cache the absolute coordinates of all droppable elements. Then, in the process of migrating a draggable element, it's evolving constantly check the coordinates with the coordinates of the droppable elements from the cache, and when the intersection coordinates, the plugin recognizes that the seized item was over-droppable-element (i.e., the event occurs
"hover"). The cache coordinates droppable elements are always calculated only once at the beginning of the transfer of the seized item.
As it conflicts with my code? As I wrote at the time of occurrence of the event
"hover" I have sent a request to the server, which returns a list of child elements, which are inserted in a nested list. Is inserted as a nested list, the coordinates of subsequent (downstream) droppable elements are changing, but the cache coordinates doesn't know about it.
As a result, if to seize the very first item, hold on a second element (wait for the nested list) and then lead it down, the third and subsequent elements will react even before the dragged item really will be over them (because the cache coordinates was the old coordinates and he still thinks that all droppable elements remained in their original positions).
How to solve this problem, the principle is clear: to count the cache's coordinates (you call a method
$.ui.ddmanager.prepareOffsets(this, event)
) after the insertion of child list.
But just calling this method does not work: his name has changed in the design process and minimize the designer of jQuery UI (I don't use a giant archive with a bunch of js files, and collected
designer single file).
How here to be? How to call a method whose name has "obfuscated"?
Online example of my own development
here.