# I want to hide a bulk action in \<c8y-data-grid\>

**URL:** <https://community.cumulocity.com/t/i-want-to-hide-a-bulk-action-in-c8y-data-grid/6359>\
**Category:** Forum\
**Tags:** cumulocity\
**Created:** [October 7, 2024, 4:56am UTC](https://community.cumulocity.com/t/i-want-to-hide-a-bulk-action-in-c8y-data-grid/6359 "2024-10-07T04:56:18Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Christof\_Strack](https://dub1.discourse-cdn.com/flex005/user_avatar/community.cumulocity.com/christof_strack/32/30066_2.png) [@Christof\_Strack](https://community.cumulocity.com/u/Christof_Strack)\
**Post date:** [October 7, 2024, 4:56am UTC](https://community.cumulocity.com/t/i-want-to-hide-a-bulk-action-in-c8y-data-grid/6359/1 "2024-10-07T04:56:18Z")

</div>

I want to hide a bulk action in a Data Grid `<c8y-data-grid>` with the [following code](https://github.com/Cumulocity-IoT/cumulocity-dynamic-mapper/blob/78ef7ff25721da72abb36474b94cc4a1b6038373/dynamic-mapping-ui/src/mapping/grid/mapping.component.ts#L264) in my component:

```auto
    this.bulkActionControls = [
      {
        type: BuiltInActionType.Delete,
        callback: this.deleteMappingBulkWithConfirmation.bind(this),
        showIf: (selectedItemIds) => {
			const result = true;
			// depending on selected ids hide the bulkDelete
            console.log('Selected mappings (showIf):', selectedItemIds);
            return result;
        }
]

```

 ![Screenshot 2024-10-07 at 06.32.43](https://europe1.discourse-cdn.com/flex005/uploads/cumulocity/original/3X/e/f/ef25e5f3ab16b449e829b495b07db806ce431a8b.jpeg)

I only see the console output once as:  
`Selected mappings (showIf): undefined`.  
It is not printed every time I select a row (mapping)

I would expect, that every time I select/deselect a row I see the console output:  
`Selected mappings (showIf): ['5001', '5002','5003'].`

Version:  
“@c8y/ngx-components”: “1020.26.2”

I tested the same with a simpler sample in the tutorial app and it didn’t work either.

Regards Christof

---

<div class="post-metadata">

**Author:** ![Bozhidar\_Dedov1](https://dub1.discourse-cdn.com/flex005/user_avatar/community.cumulocity.com/bozhidar_dedov1/32/18020_2.png) [@Bozhidar\_Dedov1](https://community.cumulocity.com/u/Bozhidar_Dedov1)\
**Post date:** [October 8, 2024, 3:40pm UTC](https://community.cumulocity.com/t/i-want-to-hide-a-bulk-action-in-c8y-data-grid/6359/2 "2024-10-08T15:40:46Z")

</div>

Hi Christof,

Passing IDs of selected row items to the `showIf` function of bulk action controls is not yet released in the version you mentioned. It will soon get released in one of the next 1020.x.x versions.

Cheers,  
Bozhidar

---

<div class="post-metadata">

**Author:** ![Bozhidar\_Dedov1](https://dub1.discourse-cdn.com/flex005/user_avatar/community.cumulocity.com/bozhidar_dedov1/32/18020_2.png) [@Bozhidar\_Dedov1](https://community.cumulocity.com/u/Bozhidar_Dedov1)\
**Post date:** [October 9, 2024, 9:26am UTC](https://community.cumulocity.com/t/i-want-to-hide-a-bulk-action-in-c8y-data-grid/6359/3 "2024-10-09T09:26:58Z")

</div>

The estimated release version of this improvement is 1020.31.0.

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/flex005/user_avatar/community.cumulocity.com/system/32/31990_2.png) [@system](https://community.cumulocity.com/u/system)\
**Post date:** [April 7, 2025, 9:27am UTC](https://community.cumulocity.com/t/i-want-to-hide-a-bulk-action-in-c8y-data-grid/6359/4 "2025-04-07T09:27:25Z")

</div>

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.
