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

[feature] Added nested object key access for data and column match #165

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mehmetyilmaz001
Copy link

The following has been addressed in the PR:

Description:

[feature]

Accessing nested object is available with this PR

In the value prop of ExcelColumn, you can now provide nested object path like "user.name" as in the example

const dataSet = [
  {
     user: {name: 'Mehmet', surname: 'Yılmaz'},
     period: 'Eylül - Ekim'
  },

  {
     user: {name: 'Semih', surname: 'Yavuz'},
     period: 'Haziran - Temmuz'
  }
]


class Download extends React.Component {
    render() {
        return (
            <ExcelFile>
                <ExcelSheet data={dataSet} name="Employees">
                    <ExcelColumn label="Name" value="user.name"/>
                    <ExcelColumn label="Period" value="period"/>
                </ExcelSheet>
            </ExcelFile>
        );
    }
}

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.

1 participant