Skip to main content

system.kanoa.dashboard.updateDashboardWidget

This function is part of the kanoaCore module

Description

Updates a dashboards widget

Syntax

updateDashboardWidget(widgetInfo, userId)
  • Parameters
      widgetInfo (dict)
      - dashboardWidgetId (int)
      - dashboardId (int)
      - breakpointId (int)
      - widgetId (int)
      - rowStart (int): The top row for this widget
      - rowEnd (int): The bottom row for this widget
      - columnStart (int): The left most column for this widget
      - columnEnd (int): The right most column for this widget
      - enabled (boolean)
      int userId - User ID
  • Returns
      retVal (int): # of records modified
      msg (str): error message, None if successful
  • Code Examples

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