-
Notifications
You must be signed in to change notification settings - Fork 149
feature: sort rows by column value #514
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
base: master
Are you sure you want to change the base?
Conversation
|
I haven't tried it but given that it works on the client side, I assume it only takes into account items on the current page? That would likely not be good enough since user would expect that all the data is in sorted order and not only the current page. |
|
Yep that's right, the user would need to set the page size to a high enough value to have all the data being shown to be able to sort it all. This is the same as how dynamodb > explore items on the aws console works. To have it rescan the entire table then sort would probably be beyond my knowledge. Also I realised that on my version of macOS the Unicode arrows I chose don't render properly so I will fix that since I made this on a windows desktop. |
| } | ||
| .sortable-header { | ||
| cursor: pointer; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps this should not use a pointer cursor since clicking this doesn't actually do anything. It should be on the arrows instead.
| <span class="sort-arrow sort-arrow-up" data-direction="asc" aria-label="Sort ascending" title="Sort ascending">↑</span> | ||
| <span class="sort-arrow sort-arrow-down" data-direction="desc" aria-label="Sort descending" title="Sort descending">↓</span> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
aria-label is not necessary when there is title.
| tbody.append(rows) | ||
| } | ||
| function getCellValue(row, column) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't like this relying on specific presentation details to get the items from the DOM (like extracting stuff from inside json-formatter-row-value elements and such). We have access to the original raw data - why won't we just sort those items and re-render the data using renderItems (or relevant code extracted from it)?
Addresses #292
Simply adds arrows next to each column name to sort all rows by that value asc or desc. Same as how the actual dynamodb web client can reorder rows just on the visible data currently displayed.