abinjohnedamanaabinjohnedamana MemberComments: 43 Received thanks: 13 Member since: February 2019

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

Answers

  • ShyimShyim MemberComments: 1313 Received thanks: 544 Member since: May 2015

    You could extend the base component and empty the blocks for those actions

  • abinjohnedamanaabinjohnedamana MemberComments: 43 Received thanks: 13 edited December 2019 Member since: February 2019

    You could extend the base component and empty the blocks for those actions

    Thank you for your replay

    I have found the following lines of code in /var/www/html/shopware6/development/platform/src/Administration/Resources/app/administration/src/app/component/data-grid/sw-data-grid.html.twig

    {% block sw_data_grid_body_cell_actions %}
        <sw-context-button v-else class="sw-data-grid__actions-menu">
            <slot name="actions" :item="item">
                {% block sw_data_grid_slot_actions %}{% endblock %}
            </slot>
        </sw-context-button>
    {% endblock %}

     

    I have tried the following

    {% block sw_data_grid_body_cell_actions %}
    {% endblock %}

    Not working(Showing Edit, Delete options)

    <template slot="actions">
    ok
    </template>

    Edit, Delete options hide but still showing the button

    <sw-context-button>
    </sw-context-button>

    Not working(Showing Edit, Delete options)

    <template slot="actions">
    </template>

    Not working(Showing Edit, Delete options)


    How to hide the button and the edit, delete options from admin side listing?

  • ShyimShyim MemberComments: 1313 Received thanks: 544 Member since: May 2015

    Like so

    Component.extend('my-listing', 'sw-entity-listing', {
        template: '{% block sw_data_grid_body_cell_actions %}<div v-else></div>{% endblock %}'
    });

    And use

  • abinjohnedamanaabinjohnedamana MemberComments: 43 Received thanks: 13 Member since: February 2019

    use :showActions="false"
      
    eg:     v-if="customerSearchKeywords"
        :items="customerSearchKeywords"
        :repository="repository"
        :showSelection="false"
        :columns="columns"
        :sortBy="sortBy"
        :sortDirection="sortDirection"
        :isLoading="isLoading"
        :showActions="false"
        @column-sort="onSortColumn">
       

Sign In or Register to comment.