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

Selectable rows #10

Closed
Vaevictus opened this issue Nov 1, 2016 · 3 comments
Closed

Selectable rows #10

Vaevictus opened this issue Nov 1, 2016 · 3 comments

Comments

@Vaevictus
Copy link

Hi there,

Is there any plan to implement a selectable row option natively into the reacttable component, or is this something I should be expected to implement myself with an additional column?

Cheers

@tannerlinsley
Copy link
Collaborator

Yes. But, whether we do it internally or as a plugin, I'm not sure.

What it really is under the hood is a custom cell and header that provide a
check box that are bound to an internal or external model, either with on
click callbacks or an on change callback. Its always a question of whether
the table should handle the state of those boxes or if the user should.

I believe it's both but in still architecting how that will work. Do you
have any preferences on how it could be implemented?
On Tue, Nov 1, 2016 at 4:05 AM CW notifications@github.com wrote:

Hi there,

Is there any plan to implement a selectable row option natively into the
reacttable component, or is this something I should be expected to
implement myself with an additional column?

Cheers


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#10, or mute the
thread
https://github.com/notifications/unsubscribe-auth/AFUmCUKLqKf-u-qH9bp8zeIAlmnnsfapks5q5w7LgaJpZM4Kl8DE
.

@Vaevictus
Copy link
Author

I've just implemented it myself by adding a column with a custom render function that adds the checkbox, works ok.
Your component is nice and flexible, I like it. I think it needs more configurable props on the column though. I think render should be replaced with cellRender, and an additional prop for headerRender to allow custom rendering of the header (for example a select all checkbox). I would also like to see column prop for onClick and onHover callbacks, and being able to specify width and maxWidth as props. Apart from those "issues" I was able to swap out my material-ui table for your react-table fairly easily and I am a lot happier with how it works. Working with your table felt a lot like working with the ExtJs grid; awesome.

@tannerlinsley
Copy link
Collaborator

Good news! You can already do custom headers:

columns = [{
  header: (props) => <span>My Custom Header!</span>
}]

As for other props and hook points, I'd love to discuss how we can execute on that.

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

No branches or pull requests

2 participants