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

Sortable Column for Table #322

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

@kodermax kodermax commented Feb 17, 2016

Could you please add Sortable Column for Table.

@Kikobeats
Copy link
Contributor

@Kikobeats Kikobeats commented Feb 19, 2016

Like that?

@javivelasco
Copy link
Member

@javivelasco javivelasco commented Feb 19, 2016

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

@javivelasco javivelasco closed this Mar 6, 2016
@kodermax
Copy link
Contributor Author

@kodermax kodermax commented Jun 5, 2016

and pagination
image

@UniIsland
Copy link

@UniIsland UniIsland commented Jul 14, 2016

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

@kodermax
Copy link
Contributor Author

@kodermax kodermax commented Jul 14, 2016

+1

@javivelasco
Copy link
Member

@javivelasco javivelasco commented Jul 16, 2016

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

@UniIsland
Copy link

@UniIsland UniIsland commented Jul 18, 2016

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

@javivelasco javivelasco commented Jul 18, 2016

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

@vmsoftware
Copy link
Contributor

@vmsoftware vmsoftware commented Jul 18, 2016

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

@javivelasco javivelasco commented Jul 18, 2016

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

@vmsoftware vmsoftware commented Jul 20, 2016

@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 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 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

@javivelasco javivelasco commented Feb 2, 2017

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
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
7 participants
You can’t perform that action at this time.