---
title: "Deprecation: #98168 - Binding context menu item to this"
manual: "TYPO3 Core Changelog"
version: "main"
permalink: "https://docs.typo3.org/permalink/changelog:deprecation-98168-1660890228"
source: "Changelog/12.0/Deprecation-98168-BindingContextMenuItemToThis.rst"
typo3-version: "12.0"
typo3-major: 12
type: "deprecation"
issue: 98168
forge: "https://forge.typo3.org/issues/98168"
tags: ["Backend", "JavaScript", "NotScanned", "ext:backend"]
rendered: "2026-09-29T06:32:46+00:00"
---

# Deprecation: #98168 - Binding context menu item to `this` {#deprecation-98168-1660890228}

See [forge#98168](https://forge.typo3.org/issues/98168)

## Description {#description}

Due to historical reasons, a context menu item is bound to `this` in its callback action
which was used to access the context menu item's `dataset`. The invocation of assigned callback actions
is adapted to pass the `dataset` as the 3rd argument.

Binding the context menu item to `this` in the callback is now marked as deprecated.

## Impact {#impact}

Using `this` in a context menu item callback will trigger a deprecated log entry in the browser's console.

## Affected installations {#affected-installations}

All extensions providing custom context menu actions are affected.

## Migration {#migration}

To access data attributes, use the `dataset` argument passed as the 3rd argument in the context menu callback action.

```js
// Before
ContextMenuActions.renameFile(table, uid): void {
  const actionUrl = $(this).data('action-url');
  top.TYPO3.Backend.ContentContainer.setUrl(
    actionUrl + '&target=' + encodeURIComponent(uid) + '&returnUrl=' + ContextMenuActions.getReturnUrl()
  );
}

// After
ContextMenuActions.renameFile(table, uid, dataset): void {
  const actionUrl = dataset.actionUrl;
  top.TYPO3.Backend.ContentContainer.setUrl(
    actionUrl + '&target=' + encodeURIComponent(uid) + '&returnUrl=' + ContextMenuActions.getReturnUrl()
  );
}
```
