Open khamyl opened 2 years ago
Fixes #187
I tried this out (without using the session part) - I had a different use case - I wanted to override direction to provide a way to start with a page on the default sort column (I have it defined per model) and give it the opposite direction so that it naturally sorted the other way for the default sort field I found that I required these changes to your PR for it to work in my case https://github.com/Kyslik/column-sortable/commit/7568d72b55d74acc8611b0f2b587d96dd909fa81
We might need to find a way to allow the icon to be changed or remain as the default sort icon - as not everyone using the package will be passing direction for the reason you intend.
If the direction toggle in anchors is not what you want, e.g. you needed to have two different buttons for ASC and DESC, you can override the direction in the link as follows: