Hi Marius,
Greetings from Syncfusion support.
We checked your reported query and provided code snippets and based on that we suggest you to use custom item in toolbar instead of custom toolbar to achieve your requirement. Since the toolbar is rendered as a separate component and then appended inside the grid, the parent element is not returned. On using custom toolbar item, you will get the parent element in the toolbar click event where you can use the $emit vue feature.
This is demonstrated in below code snippet,
<ejs-grid id="Grid" :toolbar="toolbar" :toolbarClick="clickHandler" :dataSource="data" :allowPaging="true" ref="grid"></ejs-grid>
<script>
export default {
data() {
return {
toolbar: [
{ text: "Emit", tooltipText: "Click", id: "emit" },
{ text: "New view", tooltipText: "New view", id: "newView" }
]
};
},
methods: {
clickHandler: function (args) {
if (args.item.id === "emit") {
this.$emit("propValue", "prop");
}
}
},
}
</script> |
We have prepared a sample for your reference. You can find it below,
Regards,
Thavasianand S.