class DataCommand

An AJAX command for implementing jQuery's data() method.

This instructs the client to attach the name=value pair of data to the selector via jQuery's data cache.

This command is implemented by Drupal.AjaxCommands.prototype.data() defined in misc/ajax.js.

Hierarchy

Related topics

Ajax API
Overview for Drupal's Ajax API.

File

core/lib/Drupal/Core/Ajax/DataCommand.php, line 16

Namespace

Drupal\Core\Ajax

Members

Name Modifiers Type Description
DataCommand::$name protected property The key of the data attached to elements matched by the selector.
DataCommand::$selector protected property A CSS selector string for elements to which data will be attached.
DataCommand::$value protected property The value of the data to be attached to elements matched by the selector.
DataCommand::render public function Implements Drupal\Core\Ajax\CommandInterface:render(). Overrides CommandInterface::render
DataCommand::__construct public function Constructs a DataCommand object.

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!lib!Drupal!Core!Ajax!DataCommand.php/class/DataCommand/8.1.x