AppSetting

AppSetting

AppSetting is a simple, storable name-value pair that users can edit through the DART UI. For example, the AppSetting called "Organization Name" stores the name of the user's organization.

AppSetting names and values should be strings. Also note that AppSetting inherits the property userCanDelete from PersistentObject. That value is true by default, but you may want to set it to false for settings you don't want users to delete.

Constructor

new AppSetting(opts)

Creates a new AppSetting

Parameters:
Name Type Description
opts object

Object containing properties to set.

Properties
Name Type Description
id string

A UUID in hex-string format. This is the object's unique identifier.

userCanDelete boolean

Indicates whether user is allowed to delete this record.

name string

The name of the setting. This should be unique, to prevent conflicts.

value string

The value of the setting.

Source:

Members

help :string

This is an optional description telling the user what this AppSetting means, or what it does. If provided, this will appear in the DART UI when the user edits the AppSetting.

Source:

name :string

Name is the name of the setting. Setting names should be unique, to prevent confusion.

Source:

value :string

Value is the value of the setting. It should be a string, so users can edit it in the DART UI.

Source:

Methods

(static) inflateFrom(data) → {AppSetting}

This converts a generic JavaScript hash/object into an AppSetting object. this is useful when loading objects from JSON.

Parameters:
Name Type Description
data object

An object you want to convert to an AppSetting. This object should have the properties 'name' and 'value'.

Source:
Example
let data = { name: 'Homer', value: 'Simpson' };
let setting = AppSetting.inflateFrom(data);

validate() → {boolean}

validate returns true or false, indicating whether this object contains complete and valid data. If it returns false, check the errors property for specific errors.

Source: