Comments (7)
Possible solutions are either adding 2nd argument to initialSort
:
initialSort : String -> Bool -> State
initialSort header isReverse =
State header isReverse
or if you want to avoid BC break adding a new initialReversedSort
(or initialSortReversed
):
initialReversedSort : String -> State
initialSort header =
State header True
Please let me know what do you prefer and I will create a PR.
from elm-sortable-table.
Another possible solution is exposing the State
type constructor, like
module Table exposing
( ...
, State(State)
...
)
And we could get the initial state by
model =
{ ...
, tableState = Table.State "Header" True
...
}
from elm-sortable-table.
I think you can do this already by defining the column with the decreasingOrIncreasingBy
sorter, no?
from elm-sortable-table.
I think you can do this already by defining the column with the decreasingOrIncreasingBy sorter, no?
Close, but not quite. The order will be as expected, but the descending/ascending state will be reversed and displayed incorrectly in the UI.
from elm-sortable-table.
Is there any workaround for enabling this?
from elm-sortable-table.
@BinaryHexer You can use a fork by adding the following to elm-package.json
:
"dependency-sources": {
"evancz/elm-sortable-table": "http://github.com/determined-ai/elm-sortable-table.git"
},
and the following to package.json
in the dependencies
stanza:
"elm-github-install": "1.6.1",
Note that you will need to run yarn run elm-github-install
before yarn run elm-make
. Finally you should use your own GitHub fork instead of the example one.
from elm-sortable-table.
@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.
from elm-sortable-table.
Related Issues (20)
- add ability to show/hide columns HOT 1
- Columns with HTML content HOT 1
- fixed column widths HOT 4
- Missing tr inside thead HOT 5
- TabBar
- Accessing the sorted rows HOT 2
- Add support for ThAttrs HOT 1
- Table rows are mis-ordered HOT 4
- Wrap row view? HOT 1
- Unsafe column identification HOT 2
- Style table HOT 1
- Custom Sorters
- Pagination HOT 2
- examples in Table.elm link to wrong repo HOT 1
- Dealing with Online Data HOT 3
- Stable sort HOT 4
- Upgrade for 0.19 HOT 1
- Storing the table state in the URL: Make Table.State non-opaque? HOT 1
- Publish 1.0.1? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from elm-sortable-table.