Setter events

Definition:

Setter events are custom defined Ubidots events (in the JavaScript context) that allow users to programatically interact with the platform through the HTML Canvas widget. These methods are designed specifically to set different parameters on Ubidots rather than getting data.

Usage:

After declaring an instance of the Ubidots class as:

var ubidots = new Ubidots();

You can set a callback function on that instance for a particular event as:

ubidots.on('UbidotsEvent', function(data){
    //Some logic
});

Where:

  • Ubidots: is the constructor of the Ubidots class

  • ubidots: is an instance of the Ubidots class

  • UbidotsEvent: is any of the following events available on Ubidots.

Setter events:

EventDescriptionResult

setDashboardDevice

Ability to set the selected device in a Dynamic Dashboard

device-id

setDashboardDateRange

Ability to set the date and time range in a dashboard, dynamic or static.

{"endTime": "now", "startTime": "now-24h"}}

setRealTime

Ability to turn on or off the dashboard real time update

true or false

refreshDashboard

Ability to refresh the dashboard data in all widget.

-

setFullScreen

Enable, Disable, or Toggle the Dashboard into Fullscreen

  • toggle : toggles the Fullscreen state of the Dashboard

  • enable : sets the Dashboard to Fullscreen

  • disable: takes the Dashboard out of Fullscreen.

Go to the Examples/Interacting with dashboard data section for examples on how to use this events.

Last updated