Module: alfresco/dashlets/Dashlet

alfresco/dashlets/Dashlet

A dashlet for use on a dashboard. It can be used in JSON page models if configured with a widgets definition. Otherwise it can be extended to define specific views. By passing in certain pre-supported classes to the additionalCssClasses config property, it's possible add padding to the body. The current available padding classes are smallpad (4px padding), mediumpad (10px padding - recommended) and largepad (16px padding).
Author:
  • Erik Winlöf
  • Martin Doyle
License:
Source:

Example

Sample configuration

{
   name: "alfresco/dashlets/Dashlet",
   id: "MY_DASHLET",
   config: {
      additionalCssClasses: "mediumpad",
      bodyHeight: 300,                             // Specify the initial height of the body
      componentId: "component.valid-dashlet",      // A valid component ID (for Share height persistence)
      pubSubScope: "DASHLET_SCOPE_",
      title: "My Dashlet",
      widgetsForTitleBarActions: [
         {
            name: "alfresco/html/Label",
            config: {
               label: "Title-bar actions"
            }
         }
      ],
      widgetsForToolbar: [
         {
            name: "alfresco/html/Label",
            config: {
               label: "Toolbar"
            }
         }
      ],
      widgetsForToolbar2: [
         {
            name: "alfresco/html/Label",
            config: {
               label: "Toolbar2"
            }
         }
      ],
      widgetsForBody: [
         {
            name: "alfresco/html/Label",
            config: {
               label: "Collaboratively administrate empowered markets via plug-and-play networks. Dynamically procrastinate B2C users after installed base *benefits. Dramatically visualize customer directed convergence without revolutionary ROI. Efficiently unleash cross-media information wit*hout *cross-media value. Quickly maximize timely deliverables for real-time schemas. Dramatically maintain clicks-and-mortar solutions without *functional solutions. Completely synergize resource sucking relationships via premier niche markets. Professionally cultivate one-to-one *customer service with robust ideas. Dynamically innovate resource-leveling customer service for state of the art customer service."
            }
         }
      ]
   }
}
 

Mixes In

Members

baseClass :string

The base css class to use for this widget
Type:
  • string
Default Value:
  • "alfresco-dashlets-Dashlet"
Source:

bodyHeight :number

Explicit height in pixels of the dashlet body
Type:
  • number
Default Value:
  • null
Source:

componentId :string

Id that will be used to store properties for this dashlet i.e. the dashlet height when using the resizer.
Type:
  • string
Source:

cssRequirements :object[]

An array of the CSS files to use with this widget.
Type:
  • object[]
Default Value:
  • [{cssFile:"./css/Dashlet.css"}]
Source:

i18nRequirements :object[]

An array of the i18n files to use with this widget.
Type:
  • object[]
Default Value:
  • [{i18nFile: "./i18n/Dashlet.properties"}]
Source:

i18nScope :string

The i18n scope to use for this widget
Type:
  • string
Source:

subClass :string

A second css class for sub classes of this widget to use to be able to target specifics in such dashlets.
Type:
  • string
Source:

templateString :String

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

titleConfig :object

Config that makes it possible to dynamically update the title. Should be supplied in the format of { titleConfig: { topic: "SOME_TOPIC", attribute: "path.to.topic.payload.attribute" } } If there is no attribute present the entire payload value will be used as the title.
Type:
  • object
Source:

widgetsForBody :object[]

Widgets to place in the body
Type:
  • object[]
Source:

widgetsForTitleBarActions :object[]

Widgets to place as title bar actions.
Type:
  • object[]
Source:

widgetsForToolbar :object[]

Widgets to place in the first toolbar
Type:
  • object[]
Source:

widgetsForToolbar2 :object[]

Widgets to place in the second toolbar
Type:
  • object[]
Source:

<inner> resizeDisabled :boolean

Whether resizing of this dashlet is disabled
Type:
  • boolean
Default Value:
  • false
Source:

Methods

onHeightStorageError(payload)

Handle errors that occur while storing the dashlet height
Parameters:
Name Type Description
payload Object The payload from the publishing of the failure topic
Source:
Fires:

onResize(evt, ui)

Handle resize events
Parameters:
Name Type Description
evt object The resize event object
ui object The data about the resize
Source:

onResizeEnd(evt, ui)

Calls resizeHandler and then saves the new width as a user preference.
Parameters:
Name Type Description
evt object The resize event
ui object The data about the resize
Source:

postCreate()

Implements the widget life-cycle method to add drag-and-drop upload capabilities to the root DOM node. This allows files to be dragged and dropped from the operating system directly into the browser and uploaded to the location represented by the document list.
Source:

postMixInProperties()

Make some of the i18n keys available for the template
Source:

processContainer(widgets, container)

Creates the widgets inside a container
Parameters:
Name Type Description
widgets The widgets to create
container The container to place the widgets in
Source: