colReorder via button
colReorder via button
![nicontrols](https://secure.gravatar.com/avatar/5f176d4555f0f9bc7e4c4a0d362e19a6/?default=https%3A%2F%2Fvanillicon.com%2F5f176d4555f0f9bc7e4c4a0d362e19a6_200.png&rating=g&size=120)
I have the following onclick:
$('.dropdown-view').on('click', function(e) {
let order = [7,6,5,4,3,2,1,0];
table.colReorder.order(order);
});
This works great and reorders the columns from back to front.
I can also jumble them up:
let order = [5,6,7,2,3,4,1,0];
table.colReorder.order(order);
However, I can never get them back to the original order. This does not work:
let order = [0,1,2,3,4,5,6,7];
table.colReorder.order(order);
I can't see an error in the log. The table just doesn't reorder.
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
I think I understand why this is now. I think the order is relative to the current order, not the original order.
So let order = [0,1,2,3,4,5,6,7] does nothing because the order is already that.
Hi @nicontrols ,
Yep, you can use
colReorder.reset()
to restore the original order.Cheers,
Colin
Thanks Colin!