cgxp.plugins.Menu

ptype
cgxp_menu
class cgxp.plugins.Menu(config)

Example Use

Sample code showing how to add a Menu plugin to a gxp.Viewer:

new gxp.Viewer({
    ...
    tools: [{
        ptype: 'cgxp_menu',
        id: 'menu',
        actionTarget: 'center.tbar',
        actionConfig: {
            text: 'My menu'
        }
    },
    {
        ptype: 'an_other_tool',
        actionTarget: 'menu',
        actionConfig: {
            menuText: 'Item'
        }
    }]
    ...
});

And for a split button menu:

new gxp.Viewer({
    ...
    tools: [{
        ptype: 'cgxp_menu',
        id: 'splitmenu',
        actionTarget: 'center.tbar',
        toggleGroup: 'maptools',
        splitButton: true,
        actionConfig: {
            text: 'My split menu'
        }
    },
    {
        ptype: 'an_other_tool',
        actionTarget: 'splitmenu',
        actionConfig: {
            menuText: 'Item'
        }
    }]
    ...
});

Config Options

Configuration properties.

actionConfig

Object Configuration object for the action created by this plugin.

actionTarget

String the place where the menu is placed. Default is ‘center.tbar’.

defaultActiveItem

Number Optional index of an action that should be active by default. Works only when using the splitButton mode. Default is 0.

id

String ID of the plugin and the menu.

splitButton

Boolean Use a split button instance of a simple menu. Default is false.

toggleGroup

String Toggle button group.

Table Of Contents

Previous topic

cgxp.plugins.Measure

Next topic

cgxp.plugins.MenuShortcut

This Page

Fork me on GitHub