Skip to main content

system.mes.dashboard.newWidget

Description

Generates an empty non-persisted widget object to provide the structure required by the API to save a new record into the database. Use with saveWidget.

Syntax

system.mes.dashboard.newWidget()

Parameters

ParameterTypeNullableDescription
None--This method does not take any parameters.

Returns

Returns a JSON representation of the newly created widget object. Keys and default values:

KeyDefault Value
namenull
descriptionnull
viewPathnull
iconPathnull
categorynull
defaultWidth2
defaultHeight2
minWidth2
minHeight2
idnull
notesnull
enabledtrue
spare1null
spare2null
spare3null

Code Examples

w = system.mes.dashboard.newWidget()
w['name'] = 'Time Series'
w['viewPath'] = 'Mes/Widgets/TimeSeries'
saved = system.mes.dashboard.saveWidget(w)
print(saved)