Module: alfresco/buttons/DropDownButton

alfresco/buttons/DropDownButton

This is a button that when clicked will reveal a drop-down display that can contain a widget model. The drop-down can be hidden by clicking on the button again, anywhere else on the page or through the use of the ESC key. It is also possible to configure topics that when published will also hide the drop-down. For example, if the drop-down contains a form it might be required to close the drop-down button when the confirmation button topic is published.
Since:
  • 1.0.52
Author:
  • Dave Draper
License:
Source:

Example

Drop-down containing a form that is hidden when confirmation button is clicked

{
  name: "alfresco/buttons/DropDownButton",
  config: {
    hideDropDownTopics: ["SAVE"],
    label: "Show Form",
    widgets: [
       {
          name: "alfresco/forms/Form",
          config: {
             okButtonPublishTopic: "SAVE",
             okButtonPublishGlobal: true,
             widgets: [
                {
                   name: "alfresco/forms/controls/TextBox",
                   config: {
                      label: "Value",
                      name: "value"
                   }
                }
             ]
          }
       }
    ]
  }
}

Members

_dropDownButton :object

This can be used to reference the widget that references the drop-down button. By default it will be a dijit/form/DropDownButton.
Type:
  • object
Default Value:
  • null
Source:

_dropDownDisplay :object

This can be used to reference the widget that references the drop-down display. By default it will be a dijit/TooltipDialog.
Type:
  • object
Default Value:
  • null
Source:

cssRequirements :Array

An array of the CSS files to use with this widget.
Type:
  • Array
Source:

hideDropDownTopics :string[]

An array of topics that when published will call hideDropDown to hide thedrop down
Type:
  • string[]
Default Value:
  • null
Source:

label :string

This is the label to display in the button.
Type:
  • string
Source:

templateString :String

The HTML template to use for the widget.
Type:
  • String
Source:

widgets :object

The widgets to render in the drop down.
Type:
  • object
Default Value:
  • null
Source:

Methods

allWidgetsProcessed(widgets)

Implements the callback to add all of the widgets into the MenuBar.
Parameters:
Name Type Description
widgets The widgets that have been successfully instantiated.
Source:

hideDropDown()

This function can be used to hide the drop down. Will be called whenever any of the hideDropDownTopics are published.
Source:

onDropDownDisplayShown()

This function is called whenever the drop down is displayed. It is necessary to publish a WIDGET_PROCESSING_COMPLETE topic to ensure that widgets can complete any processing required once they've been added to the DOM. This is especially important for form controls.
Source:
Fires:
  • module:alfresco/core/topics#event:WIDGET_PROCESSING_COMPLETE

postCreate()

Instantiates the MenuBar (a custom declared implementation) and processes the widgets assigned to ensure that the labels are localized before being sent for processing.
Source: