Search code examples
shopwareshopware6

How do i get the content in datasource, within the template in my custom extension for sw-data-grid component?


https://component-library.shopware.com/components/sw-data-grid

<sw-data-grid :dataSource="records">
<template v-slot:actions>
<sw-button v-on:click="open_popup_box( id_of_the_item )">Edit</sw-button>
</template>
</sw-data-grid>

How do i get the id_of_the_item within the record for that particular row here ?


Solution

  • <sw-data-grid :dataSource="records">
        <template #actions="{ item }">
            <sw-button v-on:click="open_popup_box(item.id)">Edit</sw-button>
        </template>
    </sw-data-grid>