get

get Method

Description

Gets an editor property value.

.get(/* String */ propertyName)

Parameters

propertyName String

The name of the editor property to be retrieved. Property names are listed here.

Returns

The value of the property.

Example

editor = new window.__editor(undefined, document.getElementById('editor-node'));

editor.startup();

// Load user preference data from the app's database
var userDataString = loadUserPreferences();

// Parse the preference data string to a JS object
var userData = JSON.parse(userDataString);

// Set the editor's preferences property
editor.set('preferences', userData);

In code that runs after the editor is closed:

// Retrieve user data from the editor
var userData = editor.get('preferences');

// Stringify and persist the user's preference data
storeUserPreferences(JSON.stringify(userData));

Note: This example assumes the integrator implements the function storeUserPreferences to store user’s preferences, and function loadUserPreferences to retrieve user’s preferences data. The integrator will need to implement these functions to store and retrieve data from the data store appropriate to their application.