-
Notifications
You must be signed in to change notification settings - Fork 65
Allow reversed initial sort #9
Comments
Possible solutions are either adding 2nd argument to initialSort : String -> Bool -> State
initialSort header isReverse =
State header isReverse or if you want to avoid BC break adding a new initialReversedSort : String -> State
initialSort header =
State header True Please let me know what do you prefer and I will create a PR. |
Another possible solution is exposing the module Table exposing
( ...
, State(State)
...
) And we could get the initial state by model =
{ ...
, tableState = Table.State "Header" True
...
} |
I think you can do this already by defining the column with the |
Close, but not quite. The order will be as expected, but the descending/ascending state will be reversed and displayed incorrectly in the UI. |
Is there any workaround for enabling this? |
@BinaryHexer You can use a fork by adding the following to "dependency-sources": {
"evancz/elm-sortable-table": "http://github.com/determined-ai/elm-sortable-table.git"
}, and the following to "elm-github-install": "1.6.1", Note that you will need to run |
@gaul Thanks! But maybe somebody should start maintaining an alternative version of this on elm-packages, because it seems many PRs are pending on this repository and maybe evanz is too busy (understandably so) to maintain this. |
Currently initial sort can be only ascending but in some cases it is useful to have it reverse (e.g. price, date).
The text was updated successfully, but these errors were encountered: