Javascript Drag and Drop

I got an error:

$(this).data("draggable") is null

When I went to redraw my web page after the user dragged a revision. After a lot of irritating screwing around, I found that you need to make it undraggable before display and then draggable again after, ie,