Custom Widget Parameters

Custom Widget Parameters

Parameters allow you to send a list of keys and values to your custom widget.

One use of these parameters is to change the way your code behaves. You can have two widgets pointing to the same link, but exhibiting different behaviors.

Each parameter may have a unique key and a value. The key will be used in your code to retrieve the parameter's value.

You can specify up to 20 parameters.


Usage in code

Before reading this section, you should read the Custom Widget tutorial in order to understand how the code works.

In your code, the parameters will be received in the onStart function, like so:

window.TagoIO.onStart((widget) => {
  const display = widget.display;

  const parameters = display.parameters;

  const parameter1 = parameters[0];
  const parameter2 = parameters[1];
});

    • Related Articles

    • ECharts Custom Widget Tutorial

      In this tutorial, we will guide you through the process of creating a Ring Gauge custom widget, which enables you to display multiple variables simultaneously in a interesting format. To achieve this, we will leverage the ECharts library, a robust ...
    • Custom Widget

      Custom Widgets are very versatile, allowing you to build whatever you need to suit your application’s needs. The widget can be built with plain web technologies like HTML, CSS, and JavaScript, but keep in mind that at least some JavaScript is needed ...
    • Configuration Parameters for Devices

      Configuration Parameters are key-value pairs that enable you to customize the behavior of your Devices in different scenarios. For example, you can use them to specify how to decode data or send downlink messages, filter your devices on Widgets, or ...
    • Heat Map Widget

      With the Heat Map widget, you can build a colorful layer with bubbles representing the intensity of the variables on top of your image. The higher the value of the variable, the more red the bubble will be, and you can also add a heat scale to this ...
    • Widget Cache system

      The caching system optimizes the performance of your dashboards by storing widget data and any computations performed using Data Analytics. This allows future requests to be served faster by utilizing results from earlier requests, thereby speeding ...