jquery - DataTables: how to reorder a column in datatables using Javascript or any function -
i using colreorder extension of datatables. , want rearrange column in table using function , not manually dragging column. know there function order() takes array parameter.
but method not move single column @ time has performance constraints when number of columns large
you have pass array new order:
var table = $('#table').datatable({ colreorder: true }); $('button#neworder').click(function() { table.colreorder.order([3,4,2,0,1], true); }); see more details here https://datatables.net/reference/api/colreorder.order()
Comments
Post a Comment