rowReorder not working

rowReorder not working

JohnConnorJohnConnor Posts: 1Questions: 1Answers: 0
edited April 2018 in Free community support

Hello;
I try to use rowReorder but it is not working correctly,

This is my Datatable create

function createSquad() {
oTable3 = $('#MyDataTable3').show().DataTable({
"columns": [
{ "data": "PersonalCode" },
{ "data": "FullName" },
{ "data": "Email" },
],
bProcessing: true,
bStateSave: false,
bPaginate: true,
"bDestroy": true,
destroy: true,
"searching": false,
"bFilter": false,
"bLengthChange": false,
"pageLength": 3,
"info": false,
"rowReorder": {
"dataSrc": ""
}
})
}
Bind to datatable;
function addEmployeeToDt()
var data2 = {
PersonalCode: data.Code,
FullName: data.FullName,
Email: data.Email
}
$('#MyDataTable3').dataTable().fnAddData(data2);
}

Answers

  • kthorngrenkthorngren Posts: 21,300Questions: 26Answers: 4,945

    The problem might be that you need to set a dataSrc. The RowReorder doc states this:

    The data point in the row that is modified is defined by the rowReorder.dataSrc. Normally you will want this to be a sequential number! The data reorder can potentially confuse end users otherwise!

    If this doesn't help then please be more specific about what is not working. Maybe you can post a link to your page or a test case with the issue:
    https://datatables.net/manual/tech-notes/10#How-to-provide-a-test-case

    Kevin

This discussion has been closed.