Hi
I am trying to reach a surrounding component from a a data grid cell component template
deleteItem(id) {
console.log(id);
}
render() {
return html`
<vaadin-grid .items=${this.items}>
<vaadin-grid-column header="item" path="name"></vaadin-grid-column>
<vaadin-grid-column>
<template class="header">delete item</template>
<template>
<button onclick="${() => this.deleteItem('[[item.id]
]')}">
delete [[item.id]
]
</button>
</template>
</vaadin-grid-column>
</vaadin-grid>
`;
}
Everything looks fine, i see the columns and the button, but the deleteItem method is never called.
Any idea what I am doing wrong?
The code is a part of a lit-element component
I got this working with the column renderer method, but it would be nice to use the template functionality
thnx