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

AG Grid tree_data and get_data_path #60

Closed
cubinet-code opened this issue Jan 1, 2025 · 3 comments
Closed

AG Grid tree_data and get_data_path #60

cubinet-code opened this issue Jan 1, 2025 · 3 comments
Assignees

Comments

@cubinet-code
Copy link

After looking at the examples, I still seem not to be able to figure out how to return the get_data_path function properly to the component as I am a react noob.

According to the AG Grid docs It seems one must return a callback to return the path field.

Any hints would be much appreciated!

I tried a few different ways:

class State(rx.State):
    def get_data_path(self, row: dict) -> list[str]:
        print(row)
        return row["path"]

def report_grid(id, row_data, column_defs) -> rx.Component:
    return ag_grid(
        id=id,
        row_data=row_data,
        column_defs=column_defs,
        width="100%",
        tree_data=True,
        get_data_path=State.get_data_path,
    )

also get_data_path=lambda e0: e0["path"]

Copy link

linear bot commented Jan 1, 2025

@masenf masenf self-assigned this Jan 13, 2025
@masenf
Copy link
Contributor

masenf commented Jan 13, 2025

I have an example and update in review here #63

@cubinet-code
Copy link
Author

Thank you! Much appreciated!

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

2 participants