Custom Gadget
Introducción
Currently in the Platform we have the concept of Gadget Template, which is a template created with JS + CSS + HTML and that can be instantiated by assigning a set of parameters.
The new concept of custom gadget is a specific instantiation of a Gadget Template with its parameters already assigned. For example, you could create a map-type template gadget that allows you to select the country as a parameter, and have a custom gadget instantiated for Spain that you can call Spain Map.
Creación from the Dashboard of a Custom Gadget
You have two new options to drag to your dashboard, "FROM TEMPLATE" and "CUSTOM GADGET"
Element “FROM TEMPLATE“: with this type of gadget, you can create gadgets from Gadgets templates or from scratch, by selecting the type of template that you want to use as a base. These can be Angular JS or others.
The Gadgets Template to which you have access of this type appear. You can, as indicated in the image, create your gadget with an empty template of the selected type or with one already created previously. The template code will be copied to the dashboard at this time and you will be allowed to modify it, although it will not take subsequent changes in the Gadget Template used, as it is uncoupled from it.
Â
Element “CUSTOM GADGET“: with this option you will create your custom gadget.
Select the template that will be one of the Gadgets Templates to which you have access. Then you can either select a custom gadget and press ADD GADGET, thus using a previously created instance; or click on NEW GADGET to create a new instance where you will select the datasource and the parameters required by the Gadget Template. These custom gadgets are related to the template gadget, so if something is changed in it, it will be changed in all its instances, reflecting these changes in all the dashboards that use them.
Â
The gadget list screen has been modified to perfectly differentiate the templates of gadgets and custom gadgets.
In addition, specific screens have been created to show edit and create custom gadgets like this from the Control Panel, where you can modify the parameters and the datasource and have a preview of your custom gadget: