mui / mui-toolpad

Toolpad Studio: Low-code admin builder. Open-source and powered by MUI.
https://mui.com/toolpad/
MIT License
805 stars 201 forks source link

Unable to navigate to another Toolpad page from datagrid #3487

Closed prakhargupta1 closed 1 week ago

prakhargupta1 commented 2 weeks ago

Summary

I have a data grid with a list of orders. From the order ID field, I want to open the order details page. I thought of two options to do this, but none worked.

Option 1

By converting the OrderID field to a link component. But then the Link field is not customizable as mentioned in https://github.com/mui/mui-toolpad/issues/2568 and https://github.com/mui/mui-toolpad/issues/1561

Option 2

Since my use case is to navigate to another page within the Toolpad app, I thought of using the Button component as it has the onClick navigation action. However, a Button component is not available inside the data grid. So, I created a custom button component. Now, this button works fine when outside of Datagrid, but it fails to work when I use it inside the data grid. Video below:

https://github.com/mui/mui-toolpad/assets/92228082/c99184fb-4224-4952-925c-0b4c2be01b4a

Search keywords: navigate

Janpot commented 2 weeks ago

I think the solution will be to expand the link column type:

In that sense, I'd consider this issue and https://github.com/mui/mui-toolpad/issues/1561 as duplicates.

In the meantime, a good solution will be to work with selected row + external button, as you did in your video

prakhargupta1 commented 1 week ago

I think the solution will be to expand the link column type:

Yes, that makes sense. I'll close this issue and prioritize extending the link column type. I think it would be a good addition to data grid capabilities inside Toolpad.