views:

860

answers:

5

I'm adding list items to a page dynamically with $.get, then appending them to the OL element. Pretty usual to this point.

But jQuery isn't aware of these new items when they get loaded into the page, and I'm not being able to make them sortable.

I made some trials with jQuery Live, but didn't get anywhere whit that...

+2  A: 

Did you try .sortable('refresh')? http://docs.jquery.com/UI/Sortable#method-refresh

Tommy Knowlton
A: 

Did anyone solved this issue? I'm having same problem right now..

.sortable('refresh') doesn't seem to work.

taktu
A: 

same here. sortable('refresh;) is doing nothing for me.

Stephen Belanger
A: 

on the tail end of your code just append .sortable({}); with all your parameters respecified. There's probably a way to do this without duplicating your code by using a function or something, but at least this works.

$('#List').live('click',function(e){

var myHTMLcode = '

  • New Item
  • '

    myHTMLcode.appendTo('#List').sortable({ items : 'li', axis : 'xy',

    update : function(event, ui){SPECIFIC Sortable FUNCTION CODE HERE}).fadeIn(); )};

    James
    A: 

    same problem . what is the solution ?

    Oguz