In many of my webpages that I've created using the Capabilities API, I had to create a custom menu and I always used Bootstrap's Dropdown component. In this tutorial I will show how to do the same.
From the Mashup Editor, create a new project and give it a name, using "Grid Mashup Template". this will include bootstrap for you.
.
Select the app "Helpdesk Management.qvf".
From the right hand side, create a list and select "Department" from the Dimensions. Make sure you add a callback function, since that is where we will put our code. Here, I named it showData.
Now, lets go to the html template and add the dropdown code.
In the div that has the id="QV01", add the following:
The selection drop down is ready. now lets add some more graphs to make it more interesting when we select a department. I added 'Open & resolved cases over time', the KPI 'High priority Cases' and 'Case Details'. So the final page should look like this:
Last, we must set the button to the original state after the user clicks on the "Clear All". We just add the following line in the code.
case 'clearAll':
app.clearAll();
$('#QV01 .dropdown button').html('Select Department <span class="caret"></span>');
Well, this is getting a little bit more complicated.
On the click even you will need to store the values into an array and have 2 buttons, confirm and cancel. On confirm, make the selections based on the stored array