OTRS API Reference JavaScript

Namespace: Core.Data

Core. Data

Provides functions for setting and getting data (objects) to and from DOM elements.
Author:
  • OTRS AG
Source:

Methods

(static) CompareObject(ObjectOne, ObjectTwo) → {Boolean}

This function compares 2 JS Objects (based on their keys and values).
Parameters:
Name Type Description
ObjectOne Object The object which should be compared
ObjectTwo Object The object which should be compared
Source:
Returns:
True if objects are equal, false otherwise.
Type
Boolean

(static) CopyObject(Data) → {Object}

This function creates a real copy of an object.
Parameters:
Name Type Description
Data Object The object which should be copied
Source:
Returns:
The copied object.
Type
Object

(static) Get($Element, Name) → {Object}

Retrieve data from dom element.
Parameters:
Name Type Description
$Element jQueryObject jquery object.
Name String The name of the object, which can be referenced to get the data again (-> the variable name).
Source:
Returns:
The stored data or an empty object on failure.
Type
Object

(static) Set($Element, Name, Object)

Save object data to an element.
Parameters:
Name Type Description
$Element jQueryObject jquery object.
Name String The name of the object, which can be referenced to get the data again (-> the variable name).
Object Object The javascript data you want to save (any type of javascript object).
Source: