Hi!
I'm working through the new table component and our api returns data based on a user's profile permission set. If the profile doesn't have access to a field it won't get returned in the query, otherwise the data is returned with a field value and whether it's read only for them, example below:
{
Email: {
fieldValue: "someone@myemail.com",
readOnly: false
},
Job_Function__c: {
fieldValue: "Operations",
readOnly: true
}
}
The table does a fairly decent job of predicting the column labels based on field name but with our custom fields in salesforce ending in __c
we end up seeing "Job function c" and have to go in and manually edit them to be user friendly. In a list view I'm able to reference the value of the item at index "i" and apply some javascript to format it accordingly so I'm wondering if it's possible to have that same ability in the table? The closest I've come to being able to do that is to use {{Object.keys(self.selectedSourceRow)[0]}}
but the index is hardcoded so I have to know how many fields are returned for a profile, which ideally I wouldn't need to know.
The next thing is to dynamically set whether a column is editable. From above our api does return that value. However, once you set the mapped value to {{item.fieldValue}}
(in our case) "item" is then the mapped value and no longer (again in our case) the object that that is the value of the Email key, so I'm not also able to set editable to {{item.readOnly}}
. Instead I've had to have knowledge of what it is again and use {{currentSelectedRow.Email.readOnly===false}}
. Here either continued access to item or some kind of ability to use the value of readOnly on the field at index "i" would be helpful, or please let me know if I'm missing the functionality that exists and would accomplish this.