Module: bajaux/dragdrop/NavNodeEnvelope


new (require("bajaux/dragdrop/NavNodeEnvelope"))(arr)

Envelope for transforming raw JSON into NavNode instances, or vice versa.

Extends:
Parameters:
Name Type Description
arr Array.<Object> | Array.<baja.NavNode>

either an array of raw
JSON to be converted to NavNodes, or an array of NavNodes to be converted
to JSON

Throws:

if a non-Array given

Type
Error

Methods


getMimeType()

Overrides:
Returns:

niagara/navnodes

Type
string

toJson()

Get the JSON representations of the envelope's NavNodes:

[{
  "name": "navName",
  "displayName": "navDisplayName",
  "description": "navDescription",
  "icon": "navIcon",
  "ord": "navOrd",
  "typeSpec": "typeSpec",
  "kids": [ \/* child nav node JSON objects *\/ ]
}]
Overrides:
Returns:

promise to be resolved with an array of raw
JSON objects

Type
Promise

toValues()

Get the actual NavNodes represented by this envelope.

Overrides:
Returns:

promise to be resolved with an array of
NavNode instances

Type
Promise