Get Column order from datatable (ColVis used) !

Get Column order from datatable (ColVis used) !

bousselhambousselham Posts: 3Questions: 0Answers: 0
edited May 2013 in General
Hi All,
I've used ColVis to reorder my table column, but I want to save the order so I can display my table with the same order. Can anyone help out with this problem ?

Best Regards,

Replies

  • allanallan Posts: 63,516Questions: 1Answers: 10,472 Site admin
    ColVis doesn't change the order - it just makes some columns visible and others hidden. DataTables' built-in state saving will remember which columns are hidden if you enable that ( bStateSae ).

    Allan
  • bousselhambousselham Posts: 3Questions: 0Answers: 0
    Thanks Allan, actually I use the extra plugin ColReorder. how can I get rows order in order to save it ?

    Best Regards,
  • allanallan Posts: 63,516Questions: 1Answers: 10,472 Site admin
    ColReorder also should operate with the DataTables built-in state saving. If that isn't working for you, can you link us to the page you are working on so we can see what is going wrong?

    Allan
  • bousselhambousselham Posts: 3Questions: 0Answers: 0
    I should give an example of what I want.
    we initialize dataTable ColReorder options by this lines :

    "oColReorder": {
    "aiOrder": [0,2,1,3]
    },

    I'm asking if there is a method to get the order (aiOrder) after reordering my column? I mad it by js code (loop the objects and accessing the appropriate fields), but this is not a good method...

    Bousselham,
This discussion has been closed.