Navigate to Dashboard JS API In Code Mode
Hi Fishies,
Is there a way using any of the apis exposed in code mode to navigate to another dashboard? or trigger the click even on the tab div?
...I have tried just triggering the click event of the tab div but it's expecting some variable, I thought maybe the element itself & although passing that did stop any errors in the console, it also didn't actually navigate to the associated dashboard. If you can tell me exactly what that listener is expecting, I'd happily just trigger that event.
Use Case: We have a custom vertical navigation menu on the side of the dashboard that currently changes the href location with the publishUUID of the dashboard the user wants to go to. This works ok, but does add some wait time for the next dashboard to render as the page reloads entirely, it would be much smoother if we were able to trigger the normal navigation event.
Many thanks.
Lex
Hi Lex,
Thanks for contacting Yellowfin!
There might be more than one solution you could try to navigate to a separate dashboard. I ran this past our consultants and we came up with three possible avenues:
Let me know if any of those methods help.
Kind regards,
Chris
Hi Lex,
Thanks for contacting Yellowfin!
There might be more than one solution you could try to navigate to a separate dashboard. I ran this past our consultants and we came up with three possible avenues:
Let me know if any of those methods help.
Kind regards,
Chris
Hi Lex,
The dev team got back to me over the weekend and I have some good news and bad news.
The bad news is the dashboard isn't designed to handle it and currently a bug prevents you from simply using that click event in that way you want to - it won't work right now, but I'll get a defect logged and it should be quite easy to fix.
The good news is that there's a bit of a workaround that can be used here.
We don’t really support this right now, partly because the dashboard page currently isn’t designed to handle it and partly because there is a bug in our code.
While it is possible to trigger the click event for the dashboards, it will only work if the dashboard is showing in the dashboard toolbar, because that element is on the page.
In this example I have a number of dashboards available in the More Dashboard Tabs dropdown. However, I can only trigger Sales Performance and Campaign Analysis to show via code because all of the other dashboards tab elements do not exist on the page
With that in mind, this code,
$(‘div.tab[uuid=”dashboard-uuid-here”]’).click();
Should work – however it doesn’t because the way that click event is handled by our code, is wrong and that prevents the above code from working. It works when the user clicks the link, because the browser sets up the click event slightly differently.
I’ve attached a dashboard which has a sketchy workaround to this bug, it is a dashboard with a single button, which when clicked triggers a click event on the tab of Campaign Analysis, which navigates to that dashboard. What is sketchy about it is it requires setting an id onto the clicked element, which is later removed.
But keep in mind it will only work if the dashboard you wish to navigate to is visible on the toolbar.
I'll also get an enhancement logged so navigating to a dashboard tab without reloading can be done with an API call.
I hope that helps!
Kind regards,
Chris
Hi Lex,
The dev team got back to me over the weekend and I have some good news and bad news.
The bad news is the dashboard isn't designed to handle it and currently a bug prevents you from simply using that click event in that way you want to - it won't work right now, but I'll get a defect logged and it should be quite easy to fix.
The good news is that there's a bit of a workaround that can be used here.
We don’t really support this right now, partly because the dashboard page currently isn’t designed to handle it and partly because there is a bug in our code.
While it is possible to trigger the click event for the dashboards, it will only work if the dashboard is showing in the dashboard toolbar, because that element is on the page.
In this example I have a number of dashboards available in the More Dashboard Tabs dropdown. However, I can only trigger Sales Performance and Campaign Analysis to show via code because all of the other dashboards tab elements do not exist on the page
With that in mind, this code,
$(‘div.tab[uuid=”dashboard-uuid-here”]’).click();
Should work – however it doesn’t because the way that click event is handled by our code, is wrong and that prevents the above code from working. It works when the user clicks the link, because the browser sets up the click event slightly differently.
I’ve attached a dashboard which has a sketchy workaround to this bug, it is a dashboard with a single button, which when clicked triggers a click event on the tab of Campaign Analysis, which navigates to that dashboard. What is sketchy about it is it requires setting an id onto the clicked element, which is later removed.
But keep in mind it will only work if the dashboard you wish to navigate to is visible on the toolbar.
I'll also get an enhancement logged so navigating to a dashboard tab without reloading can be done with an API call.
I hope that helps!
Kind regards,
Chris
Hi Lex,
Just wanted to let you know that this task has now been completed and included in the latest 9.8.2 release.
Change logs for the release are here.
That wraps up this ticket so I'll mark it as closed, but feel free to come back to me if you need to discuss it further.
Kind regards,
Chris
Hi Lex,
Just wanted to let you know that this task has now been completed and included in the latest 9.8.2 release.
Change logs for the release are here.
That wraps up this ticket so I'll mark it as closed, but feel free to come back to me if you need to discuss it further.
Kind regards,
Chris
Replies have been locked on this page!