function drupal_attach_tabledrag

Same name and namespace in other branches
  1. 11.x core/includes/common.inc \drupal_attach_tabledrag()
  2. 10 core/includes/common.inc \drupal_attach_tabledrag()
  3. 9 core/includes/common.inc \drupal_attach_tabledrag()
  4. 8.9.x core/includes/common.inc \drupal_attach_tabledrag()

Assists in attaching the tableDrag JavaScript behavior to a themed table.

Deprecated

in drupal:11.5.0 and is removed from drupal:13.0.0. Use \Drupal\Core\Render\Element\Table::attachTabledrag() instead.

See also

https://www.drupal.org/node/3035565

MenuForm::BuildOverviewForm()

\Drupal\Core\Render\Element\Table::attachTabledrag()

1 call to drupal_attach_tabledrag()
RendererLegacyTest::testTableDrag in core/tests/Drupal/KernelTests/Core/Render/RendererLegacyTest.php
Tests deprecation of drupal_attach_tabledrag().

File

core/includes/common.inc, line 138

Code

function drupal_attach_tabledrag(&$element, array $options) : void {
  @trigger_error('drupal_attach_tabledrag() is deprecated in drupal:11.5.0 and is removed from drupal:13.0.0. Use \\Drupal\\Core\\Render\\Element\\Table::attachTabledrag() instead. See https://www.drupal.org/node/3035565', E_USER_DEPRECATED);
  Table::attachTabledrag($element, $options);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.