Display Label Field in Table

Display Label Field in Table

benstebenste Posts: 3Questions: 2Answers: 0

Hi All,

I have a user id in my main table which is linked to the user id in a users table. Now I want to display the full name of the person in my table instead of the id, but the id should be still the value to save it.

Here is the initialization of the field in my php file:

Field::inst( 'team.user_id_manager' ) ->options( Options::inst() ->table( 'Users' ) ->value( 'user_id' ) ->label( ['user_firstname', 'user_lastname'] ) ) ->validator( Validate::dbValues() ),

For the editor it is already working perfectly, it is showing the label (full name) and saves the user id to the database.
But I also need to have to full name of the user (label) shown in my table and not the id (value).

How can I display the label in my table?

I already searched across the forum here but I didn't find a solution.

editor class

{ "label": "Manager:", "name": "team.user_id_manager", "type": "select", "placeholder": "Select a Manager" },

table class

{ "data": "team.user_id_manager", "type": "select", "placeholder": "Select a Manager" },

Thanks for your help.

This discussion has been closed.