Search code examples
javascriptjquerytabulator

Tabulator JS - Movable Columns when changed, the table.getData() is not reflecting


When I made changes on data, it is working fine but when I change the position of the columns, it is not getting reflected on my table.getData().

Here's my code:

$('.saveTable').click(async () => {
    var options = {
        zIndex: 1020
    };

    $('body').LoadingOverlay('show', options);

    var payload = {
        gid: window.gid,
        data: table.getData()
    };

    var result = await updateMetafield(payload);
    console.log(result);
});


Please note that the jQuery code is working fine, it's just that the column position is not getting reflected on my table.getData()


Solution

  • moving columns would have no effect on output data it is purely a visual operation.

    Objects in JavaScript have no ability to be ordered, they are treated in alphabetical order of the keys.