Skip to main content

system.kanoa.dashboard.addDashboardWidget(widgetInfo, userId)

Adds a widget to a dashboards breakpoint


Parameters

widgetInfo Dictionary

- breakpointIdInteger
- columnEndIntegerThe right most column for this widget
- columnStartIntegerThe left most column for this widget
- dashboardIdInteger
- enabledbit
- rowEndIntegerThe bottom row for this widget
- rowStartIntegerThe top row for this widget
- widgetIdInteger

userId Integer


Returns

dashboardWidgetId Integer
message String None if success


Example

widgetInfo = {
"dashboardId": 4,
"breakpointId": 1,
"widgetId": 7,
"enabled": True,
"rowStart": 8,
"rowEnd": 8,
"colStart": 2,
"colEnd": 20,
}
userId = 123
dashboardWidgetId, msg = system.kanoa.dashboard.addDashboardWidget(widgetInfo, userId)
if msg: system.perspective.sendMessage('showFailerToast', msg)
else: system.perspective.sendMessage('showSuccessfulToast', 'Dashboard widget has been saved')