You can also use $("ul.items").sortableRefresh() to make all items
sortable after dynamically creating an item from javascript.

On Nov 12, 5:34 pm, asle <[EMAIL PROTECTED]> wrote:
> Thanks, your first suggestion works and is shorter than writing the
> sortable code again.
> But this does not work:
>
> var myi = 1;
> $("#additem").click(function(){
>                         $('ul.items')
>     .append('<li class="sortableitem newitem'+myi+'">newitem</li>')
>     .SortableAddItem( $('li.newitem'+myi) );
>     myi++;
>                 });
>
> Strange that I cannot addresse the div with .SortableAddItem( $
> ('li.newitem'+myi) );  Or even by ID->.SortableAddItem( $
> ('#newitem'+myi) );
> This works:
>     .append('<li class="sortableitem" id="newitem'+myi+'">newitem</
> li>')
>     .SortableAddItem(document.getElementById('newitem'+myi));

Reply via email to