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

Generic table component based on react-window #73

Closed
Tracked by #74
atompie opened this issue Dec 8, 2021 · 6 comments · Fixed by #90
Closed
Tracked by #74

Generic table component based on react-window #73

atompie opened this issue Dec 8, 2021 · 6 comments · Fixed by #90
Assignees
Labels
Milestone

Comments

@atompie
Copy link
Collaborator

atompie commented Dec 8, 2021

We need a generic table component that we could use to display data. The data can be huge so using react-window is a must (https://github.com/bvaughn/react-window).

Row height will not be variant - this is the requirement for react-window. This component should auto load on scroll.

It should be flexible enough to add new columns. It could look like this.

<Table data={}>
  <Column header="Name">{name}</Column>
  <Column header="Surname">{surname}</Column>
</Table>

Maybe the children needs to be a function like this (if react window needs this):

<Table data={} columns={["Name", "Surname]}>
  {(data) => (<Column header="Name">{data.name}</Column>
  <Column header="Surname">{data.surname}</Column>
  )}
</Table>

This is up to you how you structure the component as long as it is flexible enough to pass data and modify the display of single column.

@atompie
Copy link
Collaborator Author

atompie commented Dec 8, 2021

@danjohnson77 I assigned this one to you as you are familiar with react-window. Let me know it it is OK with you? :)

@danjohnson77
Copy link
Contributor

@atompie Yeah looks good, especially if row height can be static. Will take a look with fresh eyes in the morning and send questions but shouldn't be a problem.

@atompie
Copy link
Collaborator Author

atompie commented Dec 8, 2021

Thanks

@atompie atompie modified the milestones: version 0.6.1, version 0.6.2 Jan 4, 2022
@atompie atompie assigned atompie and unassigned danjohnson77 Jan 4, 2022
@atompie atompie added the urgent label Jan 10, 2022
@atompie atompie removed their assignment Jan 10, 2022
@Bruce-Hopkins
Copy link
Contributor

I'm looking into React window now. It seems straightforward. Do we need lazy-loading too?

Can I be assigned the issue?

@atompie
Copy link
Collaborator Author

atompie commented Jan 12, 2022

@Bruce-Hopkins Yes lazy loading would be great.

@Bruce-Hopkins
Copy link
Contributor

Bruce-Hopkins commented Jan 16, 2022

Right now the table is a single row. Should it be multiple rows? I was also thinking about being able to pass into the props the color of the row, (right now every odd-numbered row is white and every even-numbered row is yellow.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants