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

Added has footer option #1190

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

myapos
Copy link

@myapos myapos commented Apr 1, 2017

Hi AllenFang,
thank you for this library. I have made some changes. Bellow you can find a short list of them.
If you want please check these out.

  • Added hasFooter attribute
  • Useful in reporting total calculations
  • Presents footer row, always in bottom of the table while the rest of the data in table is sorted normally
  • Added an example in examples folder custom-sort-table-has-footer.js

Copy link
Owner

@AllenFang AllenFang left a comment

Choose a reason for hiding this comment

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

HI @myapos, thanks for your hard work, There're some tiny thing hope you can do :)

  1. could you please fetch upstream again? Because master have changed

  2. could you please describe what's the hasFooter for sort

@myapos
Copy link
Author

myapos commented Apr 4, 2017

Hi @AllenFang. hasFooter option gives the possibility to the user to display total data such as sums always in the last row exactly as a footer row.
The problem was that the last row was sorted among the other rows.You can see this in the example that i added in the corresponding folder (examples/js/sort/custom-sort-table-has-footer.js) I added the last row with the sums after the generation of the data products. So in this case i extract the last element and get all the other elements except the last one in a new subArr array, (see if you want the function sort in TableDataStore.js) After that i apply sorting in the subAr and rejoin the sorted subAr (0, length -1) with the last element. I did the fetch upstream again as you can see. Thank you for reviewing this!

@AllenFang
Copy link
Owner

ok, I'll review it, thanks your explanation 👍

@anikakalbrun
Copy link

Hello @AllenFang. Are you planning to add total calculation feature in footer as above in upcoming release? I found that feature really needed. Please let me know your thoughts. Thank you for great plugin!

@AllenFang
Copy link
Owner

@anikakalbrun, yes, I will support this but I can't promise when I can done for it, sorry

@Skeetfly
Copy link

How is this PR going?

@AllenFang
Copy link
Owner

As I mentioned on readme, react-bootstrap-table already stop implement any new feature and forward to react-bootstrap-table2 https://github.com/react-bootstrap-table/react-bootstrap-table2/tree/develop

And the table footer will be fully support in react-bootstrap-table2

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

Successfully merging this pull request may close these issues.

None yet

4 participants