Search code examples
pluginsgrideditshopware

How to hide grid action button from "sw-entity-listing" listing in shopware 6?


How to hide grid action buttons(Edit, Delete) from "sw-entity-listing" listing in shopware 6?


Solution

  • If you want to hide the whole actions column you can do this with the prop showActions. This would be the most simple way.

    <sw-entity-listing 
        :showActions="false">
    </sw-entity-listing>
    

    If you only want to hide the "edit" or "delete" button and not the whole actions column you can override the slots delete-action or detail-action with an empty tag or something else:

    <sw-entity-listing>
        <template #delete-action>
            My content
        </template>
    </sw-entity-listing>
    
    <sw-entity-listing>
        <template #delete-action>
            <span></span> <!-- No action here -->
        </template>
    </sw-entity-listing>
    

    The sw-entity-lising component is an extension of the sw-data-grid component. So in general you can use all props from sw-data-grid as well.