jun.an Posted June 5, 2018 Share Posted June 5, 2018 <html><head> <script type='text/javascript' src="https://xxx.com/jasperserver-pro/client/visualize.js"></script></head><body> <button onclick="dashboardA()">Dashboard Type A</button> <button onclick="dashboardB()">Dashboard Type B</button> <button onclick="dashboardBWithDifferentParams()">Dashboard Type B with different params</button> <div id="container" style="width: 100%; height: 100%;"></div> <script> function runDashboard(config) { visualize({ auth: { name: "id", password: "password", organization: "organization_1" } }, function (v) { v.dashboard(config); }); } dashboardA(); function dashboardA() { runDashboard({ resource: "pathA", container: "#container", params: {} }); } function dashboardB() { runDashboard({ resource: "pathB", container: "#container", params: { projectId: ["78CDBAFB-C517-4BCC-B7E7-C86C76F0D1CB"] }, linkOptions: { events: { click: (event, link, defaultHandler) => alert(link.parameters.projectId) } } }); } function dashboardBWithDifferentParams() { runDashboard({ resource: "pathB", container: "#container", params: { projectId: ["3DC646DA-BD65-4E5F-842F-7BA730CB79A0"] }, linkOptions: { events: { click: (event, link, defaultHandler) => alert(link.parameters.projectId) } } }); } </script></body></html>[/code]As you can see, I need to update dashboard with different params or different resource path on same div.I tried using dashboard.params({}).run(); but it only works on same resource of dashboard.Is there any way to update dashboard?Even though dashboard is refreshed, params are still previous params that I ran the first time.Help me... Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now