NaN
NaN

Reputation: 1306

Draggable no longer working after content made dynamic

I'm new to JQuery and I broke my draggable/droppable functionality after the content moved to an AJAX call.

When I had the HTML table with the data loaded on page load, everything worked fine. Now that I'm injecting it with AJAX, that functionality has stopped working.

Can someone please tell me what I need to do to get this working with everything being dynamic?

Upvotes: 2

Views: 1012

Answers (1)

Parfait
Parfait

Reputation: 1750

function initDraggable(c){
   $(c).draggable();
}
$.ajax{
   ........
   success:function(){
      initDraggable($(".draggable-item"));
   }
}

After ajax , call init function again

Upvotes: 1

Related Questions