Table is not getting updated after reordering rows....(row-order)

Table is not getting updated after reordering rows....(row-order)

p10shindep10shinde Posts: 2Questions: 2Answers: 0
edited June 2017 in Free community support

I have something like this for table....

$("#objectPriorityTable").DataTable({
    "ajax" : {
        url : "data/objectPriorityData.json",
        'async': 'false',
        dataSrc : function(json){
            var data = json;
            return data;
        },
        complete : function(jqXHR, textStatus){
            console.log(jqXHR);    
        },
        dataType : "json",
        columns : [
            { "data": "locatorType","defaultContent": ""},
            { "data": "locatorInfo","defaultContent": "" }
        ],
        columnDefs : [
            {
                "className": "dt-center", "targets": [3]
            },
            {
                width : "50%",
                "targets": 0 
            },
            {
                "targets": 1,
                width : "50%",  
            },
            {
                orderable: true, className: 'reorder', targets: 0
            },
            {
                orderable: false, targets: '_all'
            }
        ],
        rowReorder: {
            update: false
        }
    });
}

But when i reorder rows by dragging after when i drop the row the display get updated but
when I use this to get data it doesn't provide me updated data but the old data

table2 = $("#objectPriorityTable").dataTable();
table2.fnGetData();

How can I updated background structure of data...?
I have tried using draw() in "row-reorder" function callback...but it also updates the table to previous state i.e. state before reordering...

Answers

  • DeanMillsDeanMills Posts: 5Questions: 1Answers: 0

    Having the exact same problem.

    Tried everything in this documentation, but still printing the original row order.
    So frustrating

  • kthorngrenkthorngren Posts: 21,685Questions: 26Answers: 5,019

    Please don't duplicate questions. I provided an answer in the other thread with this question.

    Kevin

This discussion has been closed.