how to rank each field in datatables?
how to rank each field in datatables?
sidneycat
Posts: 3Questions: 1Answers: 0
hello!
so i have a load of data on, lets say...rabbits!
in my table i have these columns:
* rabbitID
* rabbit_height
* rabbit_weight
* rabbit_length
* rabbit_strength
so atm i do a default sort of rabbitID ascending. what i would really like, is to be able to use the search bar, to look up a rabbit ID, and then when i have that row, be able to see what is the rank of the rabbit's height, weight, length, and strength.
thanks for any advice on this!
This discussion has been closed.
Answers
https://datatables.net/reference/option/order
hey dude, thanks for replying.
i understand that i can order the data for the initial presentation, but im wondering if there is some kind of API functionality I can use to get the rank of each stat.
So, yeah I can order my rabbits initially by ID and length ascending, but if i then start clicking and ordering stuff, and then i search for a specific rabbit ID, can I use the API to build some custom functionality where I can display next to the rabbits weight what rank is their weight, and then next to the rabbits strength what rank is their strength etc
if not, i guess i can do it serverside, but it would nice to have this functionality available within datatables. thanks!
...also congrats on 420 posts
There is a multi order option too https://datatables.net/reference/option/orderMulti
420? wow, I need to get a life.
I vaguely remembered something about ranking, and this was it:
https://datatables.net//forums/discussion/40581
HIH