Monster.Components.TreeMenu. TreeMenu

TreeMenu

You can create this control either by specifying the HTML tag <monster-tree-menu /> directly in the HTML

<monster-tree-menu></monster-tree-menu>

or using Javascript via the document.createElement('monster-tree-menu'); method.

import {TreeMenu} from 'https://cdn.jsdelivr.net/npm/@schukai/[email protected]/dist/modules/treemenu.js';
document.createElement('monster-treemenu');

Constructor

new TreeMenu()

A TreeMenu control

Since
  • 1.0.0
Fires:
  • Monster.Components.TreeMenu.event:monster-fetched

Members

defaults

This method is called internal and should not be called directly.

This method is called internal and should not be called directly.

The defaults can be set either directly in the object or via an attribute in the HTML tag. The value of the attribute data-monster-options in the HTML tag must be a JSON string.

<monster-treemenu data-monster-options="{}"></monster-treemenu>

Since 1.18.0 the JSON can be specified as a DataURI.

new Monster.Types.DataUrl(btoa(JSON.stringify({
       shadowMode: 'open',
   })),'application/json',true).toString()
Properties
NameTypeDefaultDescription
toggleEventTypeObjectclick,touch

List of event types to be observed for opening the dropdown

templatesObject

Template definitions

Properties
NameTypeDescription
mainstring

Main template

datasourceDatasource

data source

mappingObject
Properties
NameTypeDefaultDescription
selectorString*

Path to select the appropriate entries

labelTemplateString""

template with the label placeholders in the form ${name}, where name is the key

keyTemplateString""

template with the key placeholders in the form ${name}, where name is the key

rootReferencesString['0',

undefined, null]

idTemplateStringid
parentTemplateStringparent
selectionString

(static) observedAttributes

This method determines which attributes are to be monitored by attributeChangedCallback().

This method determines which attributes are to be monitored by attributeChangedCallback().

Since
  • 1.15.0

Methods

assembleMethodSymbol() → {Monster.Components.TreeMenu.Form}

Returns:
Type: 
Monster.Components.TreeMenu.Form

initMethodSymbol()

(static) getCSSStyleSheet() → {Array.<CSSStyleSheet>}

This method is called internal and should not be called directly.

This method is called internal and should not be called directly.

Returns:
Type: 
Array.<CSSStyleSheet>

(static) getTag() → {string}

This method is called internal and should not be called directly.

This method is called internal and should not be called directly.

Returns:
Type: 
string