function ajax_command_changed
7.x ajax.inc | ajax_command_changed($selector, $asterisk = '') |
Creates a Drupal Ajax 'changed' command.
This command instructs the client to mark each of the elements matched by the given selector as 'ajax-changed'.
This command is implemented by Drupal.ajax.prototype.commands.changed() defined in misc/ajax.js.
Parameters
$selector: A jQuery selector string. If the command is a response to a request from an #ajax form element then this value can be NULL.
$asterisk: An optional CSS selector which must be inside $selector. If specified, an asterisk will be appended to the HTML inside the $asterisk selector.
Return value
An array suitable for use with the ajax_render() function.
Related topics
2 calls to ajax_command_changed()
- ajax_forms_test_advanced_commands_changed_asterisk_callback in drupal-7.x/
modules/ simpletest/ tests/ ajax_forms_test.module - Ajax callback for 'changed' with asterisk marking inner div.
- ajax_forms_test_advanced_commands_changed_callback in drupal-7.x/
modules/ simpletest/ tests/ ajax_forms_test.module - Ajax callback for 'changed'.
File
- drupal-7.x/
includes/ ajax.inc, line 1062 - Functions for use with Drupal's Ajax framework.
Code
function ajax_command_changed($selector, $asterisk = '') {
return array(
'command' => 'changed',
'selector' => $selector,
'asterisk' => $asterisk,
);
}