Comment on page

Preload Dashboard data

This feature makes the Dashboard data available for the user at load time.
This consist of a togglable button that, when activated, changes the Widget logic so that the Dashboard data gets preloaded, making it available for the user along with the dashboard loading.
Before this feature was developed, the user could only retrieve data from the Ubidots class by setting an event and capturing the required variable on the callback.
For example, If the user wanted to get his Ubidots Token and the ID of the currently selected device, it could be achieved as follows:
var ubidots = new Ubidots();
ubidots.on('ready', async function ()
token = ubidots.token;
deviceID = ubidots.selectedDevice;
However, this requires that the user knows some advanced Javascript knowledge as well as the custom Ubidots events.
With the Preload dashboard data feature, the requirement above can be achieved as easy as:
token = ubidots.token;
deviceID = ubidots.selectedDevice;
Note that there is no need to instantiate the Ubidots class, since it already has.

Preload dashboard data interaction with Ubidots Custom events:

By enabling this feature, none of the Ubidots custom events will be available anymore to be invoked in any form.

Preload dashboard data interaction with Ubidots JavaScript class methods:

Unlike the previous case, enabling this feature won't prevent you from using the class's methods.