mui-toolpad icon indicating copy to clipboard operation
mui-toolpad copied to clipboard

Datagrid link column should support aliasing

Open prakhargupta1 opened this issue 2 years ago • 3 comments

Duplicates

  • [X] I have searched the existing issues

Latest version

  • [X] I have tested the latest version

Summary 💡

From a data grid cell, I want to take the end-user to another page of the app. For example app and screenshot below, the column name is sales_rep.

Screenshot 2023-01-16 at 1 50 32 PM

Now, instead of showing the link, I want to show Open for all rows. Even better would be, if I can make the adjacent column sales_rep_employee_number a hyperlink that takes a custom link based on the employee id.

Solution

Columns should support creating an alias.

Benchmarks

  1. Metabase:
Screenshot 2023-02-12 at 14 50 48
  1. Retool link: There was no option to add alias to link. Screenshot 2023-01-16 at 9 43 22 PM

  2. Retool Button: Button works for this use case Screenshot 2023-01-16 at 9 50 39 PM

Two more points to note in the above screenshot:

a. The navigation is to a Retool page, so based on if the app is in edit mode or dev mode they manage the URL themselves. b. The URL params are contextual i.e, they are available based on the action you are taking 'Go to Retool page' in this case. It then asks you to assign a key which is then accessible under urlParams object on the other page.

prakhargupta1 avatar Jan 16 '23 08:01 prakhargupta1

@prakhargupta1 this sounds more like a case for custom component. We can now create custom components to be rendered inside data grid cells, so it should be easy to model it accordingly.

bytasv avatar Jan 16 '23 10:01 bytasv

If we have a "link" column type, I think it's not too far fetched to have it support both url and text.

Janpot avatar Jan 16 '23 14:01 Janpot

If we have a "link" column type, I think it's not too far fetched to have it support both url and text.

Yeah, in my opinion sounds like a common-enough use case that we should support it.

apedroferreira avatar Jan 16 '23 17:01 apedroferreira