I am using DataTables along with the rowReorder plugin against a static table (non AJAX) - everything initialises fine but when I drag a row, whilst it moves within the tabl
this is code to destroy and reset datatable
if ($.fn.DataTable.isDataTable("#categoryListDataTable"))
{
$("#categoryListDataTable").dataTable().fnDestroy();
}
var table = $('#categoryListDataTable').DataTable( {
rowReorder: true,
} );
table.on( 'row-reorder', function ( e, diff, edit ) {
var res = '';
for ( var i=0, ien=diff.length ; i
made this another function due to getting values and run ajax to save at server side
function getVal(res)
{
var atmp = res.split('=');
var newId = '';
var newArr = [];
for(var i=0,j=atmp.length;i';
$.ajax({
data:{new_:newArr},
url:urlStr,
cache:false,
method:'POST',
success:function(data){
console.log(data);
},
error:function(error){
console.log(error);
}
});
}