pbeshai / react-taco-table

A table component for React based on column configuration :taco:
http://pbeshai.github.io/react-taco-table/
MIT License
30 stars 7 forks source link

Sort inverts itself when reloading data. #27

Closed clementdevos closed 8 years ago

clementdevos commented 8 years ago

Hello,

Looks like the sort is broken, when the data is reloaded, the sort order is inverted (ASC-> desc, desc -> asc) or am i missing something?

We have set a default sort on the first column, splitting the label value to sort on numbers.

Or on other columns, we sort the data, change the values and the sort is either reseted or inverted.

Any ideas? Cheers.

pbeshai commented 8 years ago

Thanks, I'll take a look.

pbeshai commented 8 years ago

Can confirm this is a bug. Fixing it now.

clementdevos commented 8 years ago

You're the best, thx a lot !

pbeshai commented 8 years ago

Will be posting to npm shortly

pbeshai commented 8 years ago

Fixed in v0.3.0

clementdevos commented 8 years ago

Sweet thanks!

clementdevos commented 8 years ago

Hey @pbeshai ,i'm still having this problem.

Default sort is on A Column ASC I change the sort to the B column (defaultSort : DESC) Change the data, the sort stays on the B but is inverted (new order : ASC). Change the data again, the sort stays ASC on the B column

clementdevos commented 8 years ago

I need to refactor our data generation before going any further.

pbeshai commented 8 years ago

Thanks for letting me know. I'll try to reproduce in a bit

clementdevos commented 8 years ago

Yeah i think it's still buggy. I've simplified our data structure but it stills reverts to an ASC sorting when reloading the data.

pbeshai commented 8 years ago

Yep I think I've got it now. Put my keep direction check in the wrong place.

pbeshai commented 8 years ago

Ok should be fixed in v0.3.1

clementdevos commented 8 years ago

Confirmed fix! Thanks!