에서 작동하지 않는, 내가 사업부를 다시로드끌어 내가 아약스를 통해 데이터를 삽입 할 때 정렬 자바 스크립트
$("#example_wrap").load(window.location.href + " #example");
을 사용했지만,이 작업을 수행 한 후, 내 드래그하고 목록이 작동하지 않는 정렬 그래서 난 그냥 사용
sort_table;
$('#example tbody').sortable('destroy');
$('#example tbody').unbind();
sort_table;
정렬 기능은 변수 sort_table
sort_table =
$("#example tbody").sortable({
axis: 'y',
update: function (event, ui) {
var self = $(this)[0];
var tr = $(self).find('tr');
topnews_a = [];
var order = 1;
$(tr).each(function(){
var content_id = parseInt($(this).attr('content_id'));
var order_id = order;
topnews_a.push({
content_id: content_id,
order_id: order_id,
});
order++;
});
var topnews_obj = JSON.stringify(topnews_a);
var data_a = {
topnews: topnews_obj
}
$.ajax({
type:"POST",
url: base_url+"topnews/do_order",
data: data_a,
beforeSend:function(){
//$('.clearClassBlock').html('<div class="alert alert-danger alert-dismissable">Select A Section.</div>');
},
complete:function(){
},
success:function(x){
alert('Order Changed Successfully');
},
error:function(x){
}
});
}
});
만약'sort_table'이 당신이 그것을 호출 할 필요가있는 함수라면 : –
sort_table 변수 코드는 질문에 추가되고, 변수는 – Midhun