Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

EN | ES

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

...

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

We select 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 To add a new entry,:

There are two options to create : 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 Create an entry with each position to see the difference, we must bear . Bear in mind that, if we you do not assign an image path, the icon that we will show be shown will be the default one.

This is what the The header icon would look like this:


And here we you can see the new menu entry:

These options, when pressed, send the assigned code to the function:


Code Block
vm.receiveValue = function(data){ };


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


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

Code Block
languagejs
`{
"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"}]
}
}`



...