Random/Shuffle table?
Random/Shuffle table?
Chris230291
Posts: 34Questions: 10Answers: 1
Hello. I would like to have a button that shuffles the table order.
I know how to add a button that can change sorting but I have no idea how to shuffle.
I thought about a hidden column with a random int.
But I want to be able to keep pressing the button and get a random ordering each time without reassigning random ints first.
Thanks,
Chris
This discussion has been closed.
Answers
You could do something like this index column example and randomize it. The other option I can think of is to create an ordering plugin. You can look through these plugins to see if any spark some ideas. Also you can see a couple running examples here.
Maybe you can randomize whether the ordering plugin returns a -1, 1, or 0 to sort the table.
Kevin
Maybe this thread will give some ideas about making a random sort order with an index column. Might be better than the plugin suggestion.
EDIT: You can hide the index column with
columns.visible
and still sort it.Kevin