Why a function cannot be called in row-reordered event?

Why a function cannot be called in row-reordered event?

mastersusemastersuse Posts: 61Questions: 28Answers: 0
edited December 2020 in Free community support

My objective is want to call a function inside row-reordered event but it would not be happen. How to call a function inside it after the event triggered?

var table2 = $('#routeTable').DataTable({});

table2.on( 'row-reordered', function ( e, diff, edit ){
    var result = [];
    var tableData = table2.data().toArray();
    for (var i=0 ; i<tableData.length ; i++) {...}
    console.log(result);

    myfunction(result);
});

Answers

  • colincolin Posts: 15,237Questions: 1Answers: 2,599

    Yep, no reason why you can't call a function. We're happy to take a look, but as per the forum rules, please link to a test case - a test case that replicates the issue will ensure you'll get a quick and accurate response. Information on how to create a test case (if you aren't able to link to the page you are working on) is available here.

    Cheers,

    Colin

This discussion has been closed.