OTRS API Reference JavaScript

Namespace: Core.AJAX

Core. AJAX

This namespace contains the functionality for AJAX calls.
Author:
  • OTRS AG
Source:

Methods

(static) ContentUpdate($ElementToUpdate, URL, Callback) → {Object}

Calls an URL via Ajax and updates a html element with the answer html of the server.
Parameters:
Name Type Description
$ElementToUpdate jQueryObject The jQuery object of the element(s) which should be updated
URL String The URL which is called via Ajax
Callback function The additional callback function which is called after the request returned from the server
Source:
Returns:
The jqXHR object.
Type
Object

(static) FormUpdate($EventElement, Subaction, ChangedElement, FieldsToUpdate, SuccessCallbackopt) → {Object}

Submits a special form via ajax and updates the form with the data returned from the server
Parameters:
Name Type Attributes Description
$EventElement jQueryObject The jQuery object of the element(s) which are included in the form that should be submitted.
Subaction String The subaction parameter for the perl module.
ChangedElement String The name of the element which was changed by the user.
FieldsToUpdate Object DEPRECATED. This used to be the names of the fields that should be updated with the server answer, but is not needed any more and will be removed in a future version of OTRS.
SuccessCallback function <optional>
Callback function to be executed on AJAX success (optional).
Source:
Returns:
The jqXHR object.
Type
Object

(static) FunctionCall(URL, Data, Callback, DataTypeopt) → {Object}

Calls an URL via Ajax and executes a given function after the request returned from the server.
Parameters:
Name Type Attributes Default Description
URL String The URL which is called via Ajax.
Data Object The data hash or data query string.
Callback function The callback function which is called after the request returned from the server.
DataType String <optional>
json Defines the datatype, default 'json', could also be 'html'
Source:
Returns:
The jqXHR object.
Type
Object

(static) SerializeForm($Element, Ignoreopt) → {String}

Serializes the form data into a query string.
Parameters:
Name Type Attributes Description
$Element jQueryObject The jQuery object of the form or any element within this form that should be serialized
Ignore Object <optional>
Elements (Keys) which should not be included in the serialized form string (optional)
Source:
Returns:
The query string.
Type
String