Skip to content

Sortable Column for Table #322

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

Closed
kodermax opened this issue Feb 17, 2016 · 15 comments
Closed

Sortable Column for Table #322

kodermax opened this issue Feb 17, 2016 · 15 comments

Comments

@kodermax
Copy link
Contributor

Could you please add Sortable Column for Table.

@Kikobeats
Copy link
Contributor

Like that?

@javivelasco
Copy link
Member

What can be done for this is to provide a custom element for a Table heading and then add a callback function to sort data out of the table component. I'll try an example during the afternoon and leave this open meanwhile

@kodermax
Copy link
Contributor Author

kodermax commented Jun 5, 2016

like this https://www.google.com/design/spec/components/data-tables.html#data-tables-interaction
image

@kodermax
Copy link
Contributor Author

kodermax commented Jun 5, 2016

and pagination
image

@UniIsland
Copy link

Why is this issue closed?
Is sortable column still in the plan?

@kodermax
Copy link
Contributor Author

+1

@javivelasco
Copy link
Member

I think it can be achieved out of react toolbox. You can sort the source!

@UniIsland
Copy link

I think it can be achieved out of react toolbox. You can sort the source!

This is not interactive. One still need to implement the interface that tell the parent component (or backend, when paginated) to sort the source data.
If I want the table header to be clickable, I have to modify the code of react-toolbox's Table component directly.

@javivelasco
Copy link
Member

So the proper solution would be to modify the API so the Table accepts onClick handlers

@vmsoftware
Copy link
Contributor

Currently, I'm working on a DATATABLE based on RT table lógic and follow the MD spec.

I'm making it in a responsive wrapper with horizontal scroll for content and I'll happy to share if @javivelasco agree...

This is a preview with header selected items, filters, pagination and rows per page..
I'm working on sortable column right now.

screenshot_20160717-214924

And filter like this:

screenshot_20160718-084451

@javivelasco
Copy link
Member

Nice! Did you change the code for the Table component we provide? Maybe we can include useful changes to make it more flexible so you can easily write this kind of wrappers and customize as you want

@vmsoftware
Copy link
Contributor

@javivelasco

yes I have modified 3 files but not directly. I copied the table directory from RT, created a DataTable.js for manage the state (filters, rows per page and other), add the header and footer and modified a little the Table.js and TableRow.js files to include a callback for tableHeadercolumnClick, assing the event for select rows and some small changes in your handleSelect function because the current versión don't work with the multiselectable and unselect features.

I'll try to finish during this week and upload it at the weekend. I think that RT Table can be merge some features that I did, like "headerColumnClick callback", "width of columns" in model prop and the possibility of select a row in any place of the row(not only at checkbox.

When I finish obviously I'm going to share with you for test and add all you think is good.

@joshua1
Copy link

joshua1 commented Oct 3, 2016

@vmsoftware When are you doing a PR for this , or making it a component that can be added to a project.

@devarsh
Copy link

devarsh commented Feb 2, 2017

@vmsoftware are you planning on sending a PR for this.

@javivelasco Why was this issue closed

@javivelasco
Copy link
Member

Because that's too much for a single component and it can be easily done with composition and the latest Table version.

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

7 participants