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

Tip: make dataTable.columns accept object path #1880

Open
lgrkvst opened this issue May 23, 2023 · 0 comments
Open

Tip: make dataTable.columns accept object path #1880

lgrkvst opened this issue May 23, 2023 · 0 comments

Comments

@lgrkvst
Copy link

lgrkvst commented May 23, 2023

Unsure if the project has found any active maintainers. In the meantime, if you like me are looking for a way to make dataTable.columns accept path into deep objects (e.g. info.address.zip), here's a way:

Change d[v] on this line:

(typeof v === 'string') ? d[v] : // v is field name string

into:

v.split(".").reduce((o, i) => o[i], d)

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

1 participant