New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(table): Add syncable sort-by and sort-desc props #742

Merged
merged 9 commits into from Jul 28, 2017

Conversation

Projects
None yet
2 participants
@tmorehouse
Member

tmorehouse commented Jul 25, 2017

Adds two new props to allow user to specify sorting column and direction.

The new props can be made two way by adding the .sync modifier, and will be updated whenever sorting column or direction changes.

These props complement (or can be used instead of) the sort-changed event.

Includes documentation updates

feat(table): Add syncable sort-by and sort-desc props
Adds two new props to allow user to specify sorting column and direction.

The new props can be made two way by adding the `.sync` modifier, and will be updated whenever sorting column or direction changes

@tmorehouse tmorehouse added this to the v0.19.0 milestone Jul 25, 2017

@tmorehouse tmorehouse requested a review from mosinve Jul 25, 2017

tmorehouse added some commits Jul 25, 2017

@tmorehouse tmorehouse requested review from pi0 and alexsasharegan Jul 27, 2017

@@ -382,12 +383,28 @@ will emit the `filtered` event, passing a single argument which is the complete
items passing the filter routine. Treat this argument as read-only.
### Sorting
As mentioned above in the **fields** section, you can make columns sortable. Clciking on
sortable a column header will sort the column in ascending direction, while clicking
on it again will switch the direction or sorting. Clicking on a non-sortable column

This comment has been minimized.

@mosinve

mosinve Jul 28, 2017

Member

I removed a reset by clicking on non-sortable column, because it just set sortBy to null, but parameter sort=null|<sortDesc>still sending to backend API.
On another tought, is may be up to Item provider func to deal with null sort target and remove it from query.
And on third thought, maybe better not expicitly to null sortBy, but reset it to default sortBy, defined at startup. If it not defined, then to null it.

This comment has been minimized.

@tmorehouse

tmorehouse Jul 28, 2017

Member

Although some may want to clear the sort... but you never know. The original table (from before I started working on it) cleared the sort on a non-sortable column.

Some people may want to table to display in the order sent from the server (as not having a null sort by would case b-table to sort the data which is received).

This comment has been minimized.

@mosinve

mosinve Jul 28, 2017

Member

Yep, i think that this feature should be restored at my variant of <b-table>
But it needs to be reviewed.

This comment has been minimized.

@mosinve

mosinve Jul 28, 2017

Member

I think, we can merge this branch, and i will continue to work on mine.

This comment has been minimized.

@tmorehouse

tmorehouse Jul 28, 2017

Member

OK cool... so everything looks OK in this branch?

This comment has been minimized.

@mosinve

mosinve Jul 28, 2017

Member

Mmm, Ill make a final test at local Playground doc, though

This comment has been minimized.

@tmorehouse

tmorehouse Jul 28, 2017

Member

OK good... The docs example should show the sort key and order under the table, using the .sync modifier.

This comment has been minimized.

@tmorehouse

tmorehouse Jul 28, 2017

Member

Also, I could dd a button that says 'clear sort' (which is disabled if sort-by is null) to the example.

Clicking on the button would set sort-by to null, and if sort-by is null then the button could be disabled. Sowing a bit more interactivity with with the table.

@tmorehouse tmorehouse merged commit c8ad5a3 into master Jul 28, 2017

1 check passed

ci/circleci Your tests passed on CircleCI!
Details

@tmorehouse tmorehouse deleted the tmorehouse-table-sort branch Jul 28, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment