set Method

Description

Sets an editor property value.

Syntax

.set(/* String */ propertyName, propertyValue)

Parameters

propertyName: String

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

propertyValue

The property's new value. See the property's documentation page for the propertyValue argument's data type.

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);
		

This example assumes that the application implements function loadUserPreferences to retrieve persisted user preference data.