Dennis, >My ajax search function populates a div with thumbnails, but then the >Drag/Drop >code no longer works. Me scratches head. > >Dan Switzer was kind enough to provide the information that I need to >reinitialize >the Drag/Drop Interface code. Can someone help me understand how to do >that? > >I did a quick look thru Interface docs, and a quick google on >javascript initialize. >Probably some answers there, tho I'm so new to javascript and jQuery >that it's >a blur.
Since you're replacing the DOM, the first thing you should do before you upgrade the DOM is probably remove the Drag/Drop zones using the Destroy methods: DroppableDestroy() and DraggableDestroy(). This step may not be necessary, but I'd imagine you'll run into memory leaks if you don't do it. To "reinitialize", just re-run the original Draggable() and Droppable() code. You should move this code outside of the $(document).ready() function into a custom function. Then you can run that function inside the ready() function and also call it after you've replaced the contents of the DOM. When you wipe the DOM, all the code that was originally initialized by Draggable/Droppable is lost. -Dan