<Title>Title of the widget</Title>
05 May 2016
All widgets (DataTable, Form, Charts) or any custom widget as described in the widget tutorial, share the following configuration options.
Name | Description | Example | ||
---|---|---|---|---|
Title |
The title of the widget. Supports macros if a context object exists, e.g. |
|
||
OnInit |
Javascript function that creates the widget.
|
|
||
OnInitOption |
Additional options that is to be passed to the OnInit function. |
|
||
PostRender |
A javascript function that will be executed when the content of the widget has been rendered.
|
|
||
HeaderActions |
By providing a reference to a menu XML file, it is possible to add custom actions to the widget header. |
|
||
ShowActionTooltip |
Whether the header actions tooltip should be visible or not. Default value is true. |
|
||
Html |
HTML that should be rendered inside of the widget container |
|
||
Toolbar |
Describes the toolbar of the widget. For more information, see the Toolbar chapter. |
|
||
Sidepanel |
Describes an optional sidepanel in the widget. For more information see the Sidepanel chapter |
|
||
Access |
Defines access rules. |
See Access Control |
To toggle/replace a widget with another (switching views) you can do the following.
Create the initial widget as described in the Dashboard chapter.
Also add the other widget (that you want to toggle to) in the same Dashboard but add the element: <Hidden>true</Hidden>
.
Make sure the X
, Y
, Width
and Height
elements have the same values as the initial widget.
<ToggleWidget>
<Label>Label for the command</Label>
<FontIcon>he-some-font-icon</FontIcon>
<To>the-id-of-the-widget-to-toggle-to</To>
<Access>access-rules-for-this-action</Access>
</ToggleWidget>
The <To>
element must point to the id of the widget to toggle to. To toggle back to the
initial widget create the same command as above but change the <Id>
to point to the initial widget. This means that the relationships will most likely be symmetrical in your configurations.
For <Access>
definition, see Access Control
In some cases, the user might want to evaluate a different dataset for a widget on a drilldown dashboard. This is possible by configuring the widget you want to evaluate with:
<OnInitOption name="evaluateWithDataSet" value="true" />
Example widget configuration:
<ChartWidget>
<Title>Multi Series Stacked Bar Chart</Title>
<OnInitOption name="evaluateWithDataSet" value="true" />
<ChartConfig namespace="hex:engineering">EBOMMultiSeriesStackedBarChart.xml</ChartConfig>
</ChartWidget>
JavaScript API, .loadRelatedWidgets()
is added to Widget instance. This API can be used to reload related widgets within the dashboard with different context ids. If any related widget is initially hidden, it’ll be made visible.
You need to have access to the widget instance to invoke this method. If you instead have access to Dashboard instance, see this |