Hi zusammen,
ich möchte gerne eine Association in dem Emotion-Model hinzufügen. Bisherige Teile (Fenster, etc.) konnte man ja über Ext.define und override lösen. Hat auch alle prima geklappt. Beim Model gibt es jedoch einen Fehler:
TypeError: this.types[h.ownerModel].prototype.associations.add is not a function
Hat da jemand einen Rat? Auf der Dokumentation bvon ExtJs und im Internet habe ich mich schon dumm und dämlich gesucht.
Edit: Das Override-Model sieht so aus (und wird auch geladen ;)):
//{block name="backend/emotion/model/emotion" append}
Ext.define('Shopware.apps.Emotion.model.EmotionLws', {
override: 'Shopware.apps.Emotion.model.Emotion',
associations: [
{ type: 'hasMany', model: 'Shopware.apps.Emotion.model.EmotionElement', name: 'getElements', associationKey: 'elements'},
{ type: 'hasMany', model: 'Shopware.apps.Emotion.model.EmotionShop', name:'getShops', associationKey:'shops'},
{ type: 'hasMany', model: 'Shopware.apps.Emotion.model.Region', name:'getRegions', associationKey:'regions'},
],
});
//{/block}
Viele Grüße
Lars