cancel
Showing results for 
Search instead for 
Did you mean: 

Refresh a widget after using JumpToDashboard

bbontrager
7 - Data Storage
7 - Data Storage

Is there a way to modify the JTD plugin so that when a Modal overlay with a jumped-to dashboard is closed, the widget originating the Jump is refreshed ?

 

1 ACCEPTED SOLUTION

bbontrager
7 - Data Storage
7 - Data Storage

For anyone who finds this thread, I found a way by modifying DrilledDashboardDisplayModal.js

update the existing bind() on the overlay similar to code below. This version finds and refreshes every Pivot2 widget on a dashboard after the modal overlay closes. It's not exactly my original question, but close enough for most cases.

var overlay = $('div.md-overlay');
overlay.bind('click', function () {
  $('body').trigger('click');
  console.log ('closing the window');
  prism.activeDashboard.widgets.$$widgets.forEach((widget) =>
  {
   if (widget.type == 'pivot2') {
       widget.refresh();
        console.log ('refreshing pivot widget');
      }
  } )
overlay.unbind('click', arguments.callee);
});

View solution in original post

1 REPLY 1

bbontrager
7 - Data Storage
7 - Data Storage

For anyone who finds this thread, I found a way by modifying DrilledDashboardDisplayModal.js

update the existing bind() on the overlay similar to code below. This version finds and refreshes every Pivot2 widget on a dashboard after the modal overlay closes. It's not exactly my original question, but close enough for most cases.

var overlay = $('div.md-overlay');
overlay.bind('click', function () {
  $('body').trigger('click');
  console.log ('closing the window');
  prism.activeDashboard.widgets.$$widgets.forEach((widget) =>
  {
   if (widget.type == 'pivot2') {
       widget.refresh();
        console.log ('refreshing pivot widget');
      }
  } )
overlay.unbind('click', arguments.callee);
});