I have this code running if loaded static.
HTML
<div class="control-group" id="example-2-1">
<div class="span3">
<ul class="sortable-list">
</ul>
</div>
</div>
JQUERY
// Example 2.1: Get items
$('#example-2-1 .sortable-list').sortable({
connectWith: '#example-2-1 .sortable-list',
receive: function(event, ui) {
// so if > 10
if ($(this).children().length > 1) {
//ui.sender: will cancel the change.
//Useful in the 'receive' callback.
$(ui.sender).sortable('cancel');
}
}
});
But when I run it with AJAX, the sortable doesnt work anymore.
AJAX / REMOTE DATA
jQuery.ajax({
type: "POST",
url: "index.php/data/get_data/",
success:function(response){
$('#example-2-1').append ($(response).hide().fadeIn('1000000'));
},
error:function (xhr, ajaxOptions, thrownError){
alert(thrownError);
}
});
what did I miss?
$( ".sortable-list" ).sortable();afterappend.