Re: make sortable divs and innerHTML

George Maicovschi
Sat, 01 Dec 2007 22:23:04 -0000

On Nov 30, 12:24 pm,
"i...-Rt+jRHwf3olhrNIvIkuUv7NldLUNz+W/@public.gmane.org"
<i...-Rt+jRHwf3olhrNIvIkuUv7NldLUNz+W/@public.gmane.org>
wrote:
> My problem is that elements that were included in my site with
> innerHTML can´t be sortable because the DOM doesn´t know that these
> elements are there.
> Has anybody a solution or an idea to this problem?
>
> ToM

Simply make sure that you call your Sortable.create method AFTER you
add the elements using innerHTML and that the elements are of the same
kind (same tag) as the tag specified in the Sortable.create options.
That should do it. If the sortable is created before and you add
elements through innerHTML you can also use Sortable.create to re-
create it and incorporate the newly added elements.

Hope this helps.

All the best,
George