Hallo zusammen,
ich habe ein Backendmodul, das eine eigene Entity mit normalen Feldern und einer ManyToManyAssociation zu products hat. List, create und update funktioniert.
Jetzt würde ich gerne das Feld products aus ausgeben. Wie muss ich das rendern?
import template from './kk-qanda-list.html.twig';
const { Component } = Shopware;
const { Criteria } = Shopware.Data;
Component.register('kk-qanda-list', {
template,
inject: [
'repositoryFactory'
],
data() {
return {
repository: null,
qandas: null
};
},
metaInfo() {
return {
title: this.$createTitle()
};
},
computed: {
columns() {
return [{
property: 'question',
dataIndex: 'question',
label: this.$tc('kk-qanda.list.columnQuestion'),
routerLink: 'kk.qanda.detail',
inlineEdit: 'string',
allowResize: true,
primary: true
}, {
property: 'answer',
dataIndex: 'answer',
label: this.$tc('kk-qanda.list.columnAnswer'),
inlineEdit: 'number',
allowResize: true
}, {
property: 'products',
dataIndex: 'products',
label: this.$tc('kk-qanda.list.columnProduct'),
allowResize: true
}];
}
},
created() {
this.repository = this.repositoryFactory.create('kk_qanda');
this.repository
.search(new Criteria(), Shopware.Context.api)
.then((result) => {
console.log(result);
this.qandas = result;
});
}
});
Momentan wird in der Spalte nur eine leeres Array [] ausgegeben. D.h. das wird noch gar nicht geladen.