Closed bash-j closed 7 years ago
Hi bash-j,
Below is your code (hopefully) corrected.
// Create your dashboards
myDashboardSet.addDashboard("site")
myDashboardSet.addDashboard("test")
// Retrieve those dashboards
var site = myDashboardSet.getDashboard("site")
var test = myDashboardSet.getDashboard("test")
// Add widgets
site.addWidget('convergence_widget', 'Graph', {
getData: function () {
$.extend(this.scope, {
title: 'Test Graph',
value: Math.floor(Math.random() * 50) + 40,
more_info: '',
data: [
{ x: 0, y: Math.floor(Math.random() * 50) + 40 },
{ x: 1, y: Math.floor(Math.random() * 50) + 40 },
{ x: 2, y: Math.floor(Math.random() * 50) + 40 },
{ x: 3, y: Math.floor(Math.random() * 50) + 40 },
{ x: 4, y: Math.floor(Math.random() * 50) + 40 }
]
});
}
});
test.addWidget('clock_widget', 'Clock');
myDashboardSet.addAction('Link 1', function() {
window.location.href = 'http://sitelink1/';
});
myDashboardSet.addAction('Link 2', function() {
window.location.href = 'http://sitelink2/';
});
Sincerely, Michael
Hi Michael,
Thank you so much for the quick response. I have changed my code using your guidance and the DashboardSet is now working!
Thanks again! Jonathon
Hi,
I am having trouble setting up a DashboardSet. I am not sure how what to use as the name when adding dashboards to the DashboardSet. When I load the page in my browser, the widgets from the site dashboard will display for half a second and then disappear. If I hit the Ctrl key and click on a dashboard it does not display the dashboard. I am not very familiar with javascript, so apologies if I have made an obvious error.