Hi!
In a field plugin for the panel I would like to add a link which should call a JS method from my plugin when clicked. This is my code:
panel.plugin('mshoestrng/exportstructure', {
fields: {
exportstructure: {
methods: {
openCSV() {
w = window.open('export.csv');
w.document.write('hello world');
w.document.close();
}
},
template: `
<div class="exportstructure">
<a href="javascript:openCSV()">CSV herunterladen</a>
</div>
`
}
}
});
But I get this error.
Any idea how I can solve this?