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 new value of the property. See the documentation for the property for more information.

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 saved user preference data.