JavaScript

{dialog.object}populateExpandingMenuControl Method

Syntax

{dialog.object}.populateExpandingMenuControl(id, data)

Arguments

idstring

Id for the Expanding Menu control.

dataJSON

JSON data to repopulate the control.

Description

Populates an Expanding Menu control.

Discussion

The {dialog.object}.populateExpandingMenuControl() method can be used to repopulate an Expanding Menu Control.

Example

var obj = {dialog.object}.getControl('EXPANDINGMENU1');
var data = {
    items:[
        {
            html: 'Category 1', 
            value: 'category1',
            icon: 'svgIcon=#alpha-icon-addCircleBorder:icon,24',
            action: '',
            children: [
                {
                    html: 'Action 1', 
                    value: 'action1',
                    action: 'action:1',
                    icon: 'svgIcon=#alpha-icon-bandAidCrossed:icon,24'
                },
                {
                    html: 'Action 2', 
                    value: 'action2',
                    action: 'action:2',
                    icon: 'svgIcon=#alpha-icon-bellRing:icon,24'
                }
            ]
        },
        {
            html: 'Category 2',
            value: 'category2',
            action: '',
            icon: 'svgIcon=#alpha-icon-heartSolid:icon,24',
            children: [
                {
                    html: 'Action 4', 
                    value: 'action4',
                    action: '',
                    icon: 'svgIcon=#alpha-icon-map:icon,24',
                    children: [
                        {
                            html: 'Action 4a', 
                            value: 'action4a',
                            action: 'action:4a',
                            icon: 'svgIcon=#alpha-icon-trendingDown:icon,24'
                        },
                        {
                            html: 'Action 4b', 
                            value: 'action4b',
                            action: 'action:4b',
                            icon: 'svgIcon=#alpha-icon-trendingDown:icon,24'
                        }
                    ]
                },
                {
                    html: 'Action 5', 
                    value: 'action5',
                    action: 'action:5',
                    icon: 'svgIcon=#alpha-icon-trendingDown:icon,24'
                }
            ]
        },
        {
            html: 'Category 3', 
            value: 'category3',
            action: '',
            icon: 'svgIcon=#alpha-icon-shield:icon,24',
            children: [
                {
                    html: 'Action 7', 
                    value: 'action7',
                    action: 'action:7',
                    icon: 'svgIcon=#alpha-icon-shuffle:icon,24'
                }
            ]
        }	],
    actions: {
        action: function(arg){
            alert('Action' + arg);
        }
    }
}
{dialog.object}.populateExpandingMenuControl('EXPANDINGMENU1',data);

See Also