Custom Widget

A custom widget is a user-created widget that can be programmed to do basically anything. Usage in a dashboard is identical to that of any of the built-in widgets. However, unlike those widgets, which are not editable by users, a custom widget can be given all sorts of settings, a completely custom appearance and style, and as many readouts, buttons, and inputs as desired.

Custom widgets are only editable by the organization that creates them; an OEM's custom widgets are visible/usable only for its users and the dealers and clients related to it. This ensures that OEMs maintain complete control of their custom widgets and don't have to worry about the possibility of an outside user going around and messing things up in their widgets' code.

Access Custom Widget Editor
  1. Open the navigation menu.
  2. Select the Custom Widgets item.
  3. Double-click the desired widget.
    • If no widgets exist, use the button to create one.
Toolbar

Use the button at the bottom of the custom widget editor sidebar, or the Ctrl+S keyboard shortcut, to save all changes.

Make sure to save any changes made to a custom widget before leaving the page! Changes are not saved automatically!

Building Widgets

There are three main pieces of a custom widget: the source code, the use-by-use settings, and the UI styles.

All newly created custom widgets have default code/settings/styles for a very basic button that highlights the key elements of developing a widget.

The preview at the right of the page shows what the widget would look like on a real dashboard with the current code and styles. It updates each time the widget is saved. If there is a syntax error somewhere, the widget will not appear.

Code

Click the button in the section selector to access the source code.

Widgets are built using JavaScript (JS), so JS variables, functions, and other pieces of code can be defined the same way as when writing regular JS code.

There are a few key parts/functions:

Settings

There is no maximum number of settings that can be added to a custom widget.

Click the button in the section selector to access the widget's settings.

All settings have three basic fields:

Widgets can have 7 different types of settings:

Styles

Click the button in the section selector to access the widget's styles.

This is where CSS styling for the widget can be specified. Define CSS classes and then use them anywhere in the widget source code when creating JQuery elements.