marceljuenemann / angular-drag-and-drop-lists

Angular directives for sorting nested lists using the HTML5 Drag & Drop API
MIT License
2.16k stars 715 forks source link

How to use with virtual repeaters? #292

Open lumalav opened 8 years ago

lumalav commented 8 years ago

I may have thousands of items in my lists. So, to improve speed, I need to use md-virtual-repeat offered by AngularMaterial. It keeps the model in the background with the right number of elements. But, the DOM only renders those that are visible within a virtual container. Because this library uses the rendered $index to keep track of the elements, using the virtual repeater creates all sort of problems since the $index now is virtual.

What do you suggest for this problem?

Thank you

marceljuenemann commented 8 years ago

Sounds like a hard problem to solve. Would it be sufficient to calculate the right insertion position in dnd-drop handler and then perform the insertion yourself? Does the placeholder positioning work?