ColReorder Original Index Option

ColReorder Original Index Option

chboccachbocca Posts: 86Questions: 13Answers: 1

What is the syntax for specifying original index order option in the colReorder initialization?

I know the two-step method works:

var table = $('#example').DataTable( {
    colReorder: true
} );

table.colReorder.order( [ 0, 1, 2, 3, 4, 5 ], true );

But I would like to do something like:

var table = $('#example').DataTable( {
    colReorder: {
        enable: true,
        order:  [ 0, 1, 2, 3, 4, 5 ],
        original: true
    }
} );

If not possible, no big deal.

Thanks, as always!

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 61,438Questions: 1Answers: 10,052 Site admin
    Answer ✓

    Yes. I'm afraid there isn't a colReorder.original option. However, the columns are initialised in their original order, so isn't such an option redundant?

    Allan

  • chboccachbocca Posts: 86Questions: 13Answers: 1

    Ha! Yes, thank you.

  • chboccachbocca Posts: 86Questions: 13Answers: 1

    Well, I think I was concerned that with

    stateSave: true
    
    

    it might use current order.

    But, no worries, if I come across something concrete, I will post an example.

    Thanks again!

    c

Sign In or Register to comment.