Skip to content
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 scrollable behaviour to the Table component #727

Merged
merged 6 commits into from
Sep 23, 2019
Merged

Conversation

Artikodin
Copy link
Contributor

@Artikodin Artikodin commented Sep 5, 2019

  • Feature
  • Fix
  • Enhancement

Description

We want to display severals rows and columns in a table. To avoid an unreadable shrink result we want to made our table scrollable in both axes (x & y).

The specifications says the total row should be visible if the user scroll to the bottom of the table. After reflexion with Mayssa we found that can be painful if there are a lots of rows. So we decided to stick it to the bottom.

What's new:

  • a total row is displayed only if there is a dataTotal props passed to component
  • if the isScrollable props is passed to it, the table will be scrollable when the number of columns or rows overflow the container
  • a row header is added to each row if it's defined in column definition (ref: colsDef props)

footer_scroll

⚠️ Last commit is still in work in progress. ⚠️

After @spartDev review that PR he ask me to add some shadow when the table content overflow.
I started to develop that feature but I've no time to finish it.

What's missing:

  • put top, left, right, bottom state in an object
  • rework handleScroll method to avoid that huge amount of condition
  • clean the mess I've made at the end of style file (Table/elements.js)
  • handle the case when the footer row is missing
  • make the shadow follow the header row width when it's stretching on the large screen

I you find a better way to handle the shadow you're welcome to integrate it.

Related / Associated Jira Cards :

BP-369

Todo - Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.

@Artikodin Artikodin added the feature New feature label Sep 5, 2019
@Artikodin Artikodin added need review WIP Work in progress labels Sep 5, 2019
@Artikodin Artikodin removed the WIP Work in progress label Sep 9, 2019
@@ -89,31 +91,32 @@ class Table extends PureComponent {
* @return {jsx}
*/
renderHeader() {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok guys I need to know what do think about that. Should I let component as method here or put it in an external file TableHeader. Same question for the body and footer component.

@spartDev spartDev merged commit 79eae33 into master Sep 23, 2019
@spartDev spartDev deleted the BP-369 branch September 23, 2019 12:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants