Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Current »

EN | ES

For gadgets templates an upturn has been implemented that allows us to add options.

These entries in the header or in the menu can be assigned a personalized description, code and icon.

We can create them from the gadget menu itself or from the API dashboard in the message to create the gadget.

From the gadget menu these would be the steps. We will see them with a simple example:

We select this entry in the gadget menu

This modal window appears, in which the configured options appear and a form to add new or edit existing ones.

We will add a new entry,

There are two options to create the entry in the menu that appears when you click on the icon of the three dots or in the Header that will place it in the header of the gadget.

We create an entry with each position to see the difference, we must bear in mind that if we do not assign an image path the icon that we will show will be the default

This is what the header icon would look like


And here we can see the new menu entry

These options when pressed send the assigned code to the function


vm.receiveValue = function(data){ };


We can evaluate the variable data to see what action must be taken of those that we have implemented, for example, if we click on the header option and make a trace we see that the code arrives at the function:


In the case of wanting to create the menu options from the DashboardAPI when creating a Template gadget we would send in the message the property "customMenuOptions"

`{
"command": "newGadget",
"authorization": "${token}",
"information": {
"dashboard": "identificationDashboard",
"gadgetName": "${newName}",
"gadgetType": "${type}",
"refresh": 10,
"ontology": "HelsinkiPopulation",
"setupLayout": {
"filtersInModal": false,
"hideBadges": true,
"hidebuttonclear":false
},
"customMenuOptions": [{
"id": "customMenu",
"description": "customMenuD",
"position": "menu",
"imagePath": "../../static/images/dashboards/icon_button_controls.svg"
},{
"id": "customMenu2",
"description": "customMenuH",
"position": "header",
"imagePath": "../../static/images/dashboards/icon_button_menu.svg"}]
}
}`



  • No labels