Can anyone provide guidance on how to create a new column from an Object datatype? I'm struggling with this task. Below are the settings and data for better clarity:
private settings = {
columns: {
firstName: {
title: 'First name',
type: 'text'
},
lastName: {
title: 'Last name',
type: 'text'
},
userType: {
// The current setup works fine only when there is a string in the API response named - userType
// But when I try something like - userType.value, I encounter an error
title: 'User type',
type: 'text'
},
}
Data from the API:
......
{
firstName: 'Jacob',
lastName: '',
middleName: '',
userType: {value: 'superAdmin', display: 'Super Administrator'},
login: '',
password: '',
phoneNumber: '066-233-77-34',
city: 'Rome',
address: 'someStreet',
salary: '0',
},
......