In my grid, a column „company” is mapped to an object that has fields: id, name. I use valueAccessor to display company name for this column.
Now I need this column to be editable within the grid, but I cannot map the selected value to a complex object.
See these code snippets:
this.companies = [
{id: 1, name: 'Nestle'},
{id: 2, name: 'Nivea'}
];
this.idNameFields = { text: 'id', value: 'name' };
this.companyEdit = {
params: {
query: new Query(),
dataSource: this.companies,
fields: this.idNameFields
}
};
So now when I select Nestle, the company field is set to 1 and that breaks the mapping done via valueAccessor. I want the company to be set as a whole object
{id: 1, name: 'Nestle'}. Is there a way to I set this up?