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

Open
cubinet-code opened this issue Jan 1, 2025 · 1 comment
Open

AG Grid tree_data and get_data_path #60

cubinet-code opened this issue Jan 1, 2025 · 1 comment

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

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