DataCommand
class DataCommand implements CommandInterface (View source)
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.
Properties
| protected string | $selector | A CSS selector string for elements to which data will be attached. |
|
| protected string | $name | The key of the data attached to elements matched by the selector. |
|
| protected mixed | $value | The value of the data to be attached to elements matched by the selector. |
Methods
__construct(string $selector, string $name, mixed $value)
Constructs a DataCommand object.
render()
Implements Drupal\Core\Ajax\CommandInterface:render().
Details
__construct(string $selector, string $name, mixed $value)
Constructs a DataCommand object.
render()
Implements Drupal\Core\Ajax\CommandInterface:render().