new AjaxCommands()
Provide a series of commands that the client will perform.
- Source:
Methods
add_css(ajaxopt, response, statusopt)
Command to add css.
Parameters:
Name | Type | Attributes | Description | ||||||
---|---|---|---|---|---|---|---|---|---|
ajax |
Drupal.Ajax |
<optional> |
|
||||||
response |
object | The response from the Ajax request. Properties
|
|||||||
status |
number |
<optional> |
The XMLHttpRequest status. |
- Source:
alert(ajaxopt, response, statusopt)
Command to provide an alert.
Parameters:
Name | Type | Attributes | Description | ||||||
---|---|---|---|---|---|---|---|---|---|
ajax |
Drupal.Ajax |
<optional> |
|
||||||
response |
object | The JSON response from the Ajax request. Properties
|
|||||||
status |
number |
<optional> |
The XMLHttpRequest status. |
- Source:
announce(ajaxopt, response)
Command to provide triggers audio UAs to read the supplied text.
Parameters:
Name | Type | Attributes | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
ajax |
Drupal.Ajax |
<optional> |
|
||||||||||||
response |
object | The JSON response from the Ajax request. Properties
|
- Source:
changed(ajaxopt, response, statusopt)
Command to mark a chunk changed.
Parameters:
Name | Type | Attributes | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
ajax |
Drupal.Ajax |
<optional> |
|
||||||||||||
response |
object | The JSON response object from the Ajax request. Properties
|
|||||||||||||
status |
number |
<optional> |
The request status. |
- Source:
closeDialog(ajaxopt, response, statusopt)
Command to close a dialog.
If no selector is given, it defaults to trying to close the modal.
Parameters:
Name | Type | Attributes | Description | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
ajax |
Drupal.Ajax |
<optional> |
The ajax object. |
|||||||||
response |
object | Object holding the server response. Properties
|
||||||||||
status |
number |
<optional> |
The HTTP status code. |
- Source:
css(ajaxopt, response, statusopt)
Command to provide the jQuery css() function.
Parameters:
Name | Type | Attributes | Description | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
ajax |
Drupal.Ajax |
<optional> |
|
|||||||||
response |
object | The response from the Ajax request. Properties
|
||||||||||
status |
number |
<optional> |
The XMLHttpRequest status. |
- Source:
data(ajaxopt, response, statusopt)
Command to attach data using jQuery's data API.
Parameters:
Name | Type | Attributes | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
ajax |
Drupal.Ajax |
<optional> |
|
||||||||||||
response |
object | The response from the Ajax request. Properties
|
|||||||||||||
status |
number |
<optional> |
The XMLHttpRequest status. |
- Source:
editorDialogSave(ajaxopt, response, statusopt)
Command to save the contents of an editor-provided modal.
This command does not close the open modal. It should be followed by a
call to Drupal.AjaxCommands.prototype.closeDialog
. Editors that are
integrated with dialogs must independently listen for an
editor:dialogsave
event to save the changes into the contents of their
interface.
Parameters:
Name | Type | Attributes | Description | ||||||
---|---|---|---|---|---|---|---|---|---|
ajax |
Drupal.Ajax |
<optional> |
The Drupal.Ajax object. |
||||||
response |
object | The server response from the ajax request. Properties
|
|||||||
status |
number |
<optional> |
The status code from the ajax request. |
Fires:
- event:editor:dialogsave
insert(ajax, response)
Command to insert new content into the DOM.
Parameters:
Name | Type | Description | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
ajax |
Drupal.Ajax |
|
||||||||||||||||||||
response |
object | The response from the Ajax request. Properties
|
- Source:
invoke(ajaxopt, response, statusopt)
Command to apply a jQuery method.
Parameters:
Name | Type | Attributes | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
ajax |
Drupal.Ajax |
<optional> |
|
||||||||||||
response |
object | The response from the Ajax request. Properties
|
|||||||||||||
status |
number |
<optional> |
The XMLHttpRequest status. |
- Source:
jsAjaxTestCommand(ajaxopt, response)
Test Ajax command.
Parameters:
Name | Type | Attributes | Description | ||||||
---|---|---|---|---|---|---|---|---|---|
ajax |
Drupal.Ajax |
<optional> |
|
||||||
response |
object | The response from the Ajax request. Properties
|
message(ajaxopt, response)
Command to add a message to the message area.
Parameters:
Name | Type | Attributes | Description | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
ajax |
Drupal.Ajax |
<optional> |
|
|||||||||||||||
response |
object | The response from the Ajax request. Properties
|
- Source:
openDialog(ajax, response, statusopt) → {bool|undefined}
Command to open a dialog.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
ajax |
Drupal.Ajax | The Drupal Ajax object. |
|
response |
object | Object holding the server response. |
|
status |
number |
<optional> |
The HTTP status code. |
- Source:
Returns:
Returns false if there was no selector property in the response object.
- Type
- bool | undefined
redirect(ajaxopt, response, statusopt)
Command to set the window.location, redirecting the browser.
Parameters:
Name | Type | Attributes | Description | ||||||
---|---|---|---|---|---|---|---|---|---|
ajax |
Drupal.Ajax |
<optional> |
|
||||||
response |
object | The response from the Ajax request. Properties
|
|||||||
status |
number |
<optional> |
The XMLHttpRequest status. |
- Source:
remove(ajaxopt, response, statusopt)
Command to remove a chunk from the page.
Parameters:
Name | Type | Attributes | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
ajax |
Drupal.Ajax |
<optional> |
|
||||||||||||
response |
object | The response from the Ajax request. Properties
|
|||||||||||||
status |
number |
<optional> |
The XMLHttpRequest status. |
- Source:
restripe(ajaxopt, response, statusopt)
Command to restripe a table.
Parameters:
Name | Type | Attributes | Description | ||||||
---|---|---|---|---|---|---|---|---|---|
ajax |
Drupal.Ajax |
<optional> |
|
||||||
response |
object | The response from the Ajax request. Properties
|
|||||||
status |
number |
<optional> |
The XMLHttpRequest status. |
- Source:
setDialogOption(ajaxopt, response, statusopt)
Command to set a dialog property.
JQuery UI specific way of setting dialog options.
Parameters:
Name | Type | Attributes | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
ajax |
Drupal.Ajax |
<optional> |
The Drupal Ajax object. |
||||||||||||
response |
object | Object holding the server response. Properties
|
|||||||||||||
status |
number |
<optional> |
The HTTP status code. |
- Source:
settings(ajaxopt, response, statusopt)
Command to set the settings used for other commands in this response.
This method will also remove expired drupalSettings.ajax
settings.
Parameters:
Name | Type | Attributes | Description | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
ajax |
Drupal.Ajax |
<optional> |
|
|||||||||
response |
object | The response from the Ajax request. Properties
|
||||||||||
status |
number |
<optional> |
The XMLHttpRequest status. |
- Source:
setToolbarSubtrees(ajax, response, statusopt)
Ajax command to set the toolbar subtrees.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
ajax |
Drupal.Ajax |
|
|
response |
object | JSON response from the Ajax request. |
|
status |
number |
<optional> |
XMLHttpRequest status. |
update_build_id(ajaxopt, response, statusopt)
Command to update a form's build ID.
Parameters:
Name | Type | Attributes | Description | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
ajax |
Drupal.Ajax |
<optional> |
|
|||||||||
response |
object | The response from the Ajax request. Properties
|
||||||||||
status |
number |
<optional> |
The XMLHttpRequest status. |
- Source:
updateMediaLibrarySelection(ajaxopt, response, statusopt)
Command to update the current media library selection.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
ajax |
Drupal.Ajax |
<optional> |
The Drupal Ajax object. |
response |
object | Object holding the server response. |
|
status |
number |
<optional> |
The HTTP status code. |
viewsHighlight(ajaxopt, response, statusopt)
Ajax command for highlighting elements.
Parameters:
Name | Type | Attributes | Description | ||||||
---|---|---|---|---|---|---|---|---|---|
ajax |
Drupal.Ajax |
<optional> |
An Ajax object. |
||||||
response |
object | The Ajax response. Properties
|
|||||||
status |
number |
<optional> |
The HTTP status code. |
- Source:
viewsReplaceTitle(ajaxopt, response, statusopt)
Ajax command to replace the title of a page.
Parameters:
Name | Type | Attributes | Description | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
ajax |
Drupal.Ajax |
<optional> |
An Ajax object. |
|||||||||
response |
object | The Ajax response. Properties
|
||||||||||
status |
number |
<optional> |
The HTTP status code. |
- Source:
viewsScrollTop(ajaxopt, response)
Views scroll to top ajax command.
Parameters:
Name | Type | Attributes | Description | ||||||
---|---|---|---|---|---|---|---|---|---|
ajax |
Drupal.Ajax |
<optional> |
A |
||||||
response |
object | Ajax response. Properties
|
viewsSetForm(ajaxopt, response, statusopt)
Ajax command to set the form submit action in the views modal edit form.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
ajax |
Drupal.Ajax |
<optional> |
An Ajax object. |
response |
object | The Ajax response. Contains .url |
|
status |
string |
<optional> |
The XHR status code? |
- Source:
viewsShowButtons(ajaxopt, response, statusopt)
Ajax command to show certain buttons in the views edit form.
Parameters:
Name | Type | Attributes | Description | ||||||
---|---|---|---|---|---|---|---|---|---|
ajax |
Drupal.Ajax |
<optional> |
An Ajax object. |
||||||
response |
object | The Ajax response. Properties
|
|||||||
status |
number |
<optional> |
The HTTP status code. |
- Source:
viewsTriggerPreview(ajaxopt, responseopt, statusopt)
Ajax command for triggering preview.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
ajax |
Drupal.Ajax |
<optional> |
An Ajax object. |
response |
object |
<optional> |
The Ajax response. |
status |
number |
<optional> |
The HTTP status code. |
- Source:
Type Definitions
commandDefinition
Type:
- object
Properties:
Name | Type | Attributes | Description |
---|---|---|---|
command |
string | ||
method |
string |
<optional> |
|
selector |
string |
<optional> |
|
data |
string |
<optional> |
|
settings |
object |
<optional> |
|
asterisk |
bool |
<optional> |
|
text |
string |
<optional> |
|
title |
string |
<optional> |
|
url |
string |
<optional> |
|
argument |
object |
<optional> |
|
name |
string |
<optional> |
|
value |
string |
<optional> |
|
old |
string |
<optional> |
|
new |
string |
<optional> |
|
merge |
bool |
<optional> |
|
args |
Array |
<optional> |
- Source:
- See: