Skip to content

fix: pass actual text to footerFormatter instead of column array #1147

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
wants to merge 1 commit into from

Conversation

pdrgds
Copy link

@pdrgds pdrgds commented Nov 6, 2019

It doesn't make any sense to receive an array with column items in this function, since this is already done in the "footer" function.

Example: let's say I do just like in the Storybook example:
const columns = [ { dataField: 'price', text: 'Product Price', footer: columnData => columnData.reduce((acc, item) => acc + item, 0) }];

footFormatter should just receive the result of this already executed function so I can format it.

@@ -54,7 +54,7 @@ class FooterCell extends eventDelegater(React.Component) {
if (cellClasses) cellAttrs.className = cs(cellAttrs.className, cellClasses);
if (!_.isEmptyObject(cellStyle)) cellAttrs.style = cellStyle;

const children = footerFormatter ? footerFormatter(column, index) : text;
const children = footerFormatter ? footerFormatter(text) : text;
Copy link
Member

Choose a reason for hiding this comment

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

hello @pdrgds please give text as first argument but keep index as second argument. thanks

Copy link
Member

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

Please check my comment and change your target branch to develop instead of master. btw, remember to rebase your code. thanks you contribution~

@pdrgds pdrgds changed the base branch from master to develop December 28, 2019 19:08
@pdrgds pdrgds changed the base branch from develop to master December 28, 2019 19:11
@pdrgds pdrgds closed this Dec 28, 2019
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

Successfully merging this pull request may close these issues.

2 participants