Closed t-mathis closed 9 years ago
Thanks for reporting! I'll work on this tomorrow. I'll probably use an insertion sort to put them in the right order. (this will mess up the function with people who were using it before, but IMO its worth sorting these things.)
That's a good sorting algorithm to use since it will almost always be nearly-sorted anyways, making it super fast.
This'll be solved defining a comparator attribute for the CaughtPokemons collection. This feature of backbone uses an insertion sort to ensure the list is always nearly-sorted, and saves me the trouble of writing/maintaining one of my own.
I have it working on my local machine, but only on refresh. I'm currently working to get the table to update as pokemon are added.
Pokemon added from the Pokemon tab into "Caught" are not in order. Not sure if bug... or a feature.
Here are the steps I took to do this: 1) Refresh the page. 2) Add Charizard, Charmeleon, then Charmander. 3) Validate that the "Caught" tab added the 3 Pokemon. (It showed 6, then 5, then 4.) 4) Refresh the page, and check again. (It showed 6, then 5, then 4.)