Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Need to reload the complete dashboard configuration #136

Open
cbresson33 opened this issue May 4, 2015 · 3 comments
Open

Need to reload the complete dashboard configuration #136

cbresson33 opened this issue May 4, 2015 · 3 comments

Comments

@cbresson33
Copy link

Hi there,

I am using your dashboard, and I am loving it.

I work on a dynamic dashboard, where list of widgets displayed comes from a database. There is no problem for the first loading of the dahboard, when it is created, but I need to reset the complete dashboard configuration during the user experience.

As a consequence, I need to reset the $scope.dashboardOptions variable, and reload a new configuration several times. Because of isolated scopes, resetting the variable does not make any changes on the view.

I tried to use an ng-if directive for the dashboard creation , but it worked only for the first load.

Is there a elegant way to do that, except reloading the complete page ?

Thank you...

@andyperlitch
Copy link
Collaborator

@cbresson33, apologies for the late response. The dashboard directive will definitely need to be re-initialized/recompiled. It may not be the most elegant, but you could do something like this:

template:

<div ng-if="myOptions">
  <dashboard options="myOptions"></dashboard>
</div>

then, in your controller:

// Assuming you want to use a new options object called `newOptions`:
$scope.myOptions = false;
$timeout(function() {
  $scope.myOptions = newOptions;
}, 0);

@robertmazzo
Copy link

@andyperlitch - do you think what I'm trying to achieve is the same as this issue ? see #142
i.e. I need to dynamically switch out templateUrl, then I expect the widget to be refreshed with the updated chart type.
This is what I would normally do: $scope.result.templateUrl = $scope.widget.templateUrl; , however the widget doesn't re-render the updated templateUrl until I do a hard refresh.

see #142

@suvigyavijay
Copy link

Hi,
I am pretty much facing the same problem.
I need to add widgetDefinitions dynamically to the array, but even when I do that they aren't reflected on the dashboard until I reload the complete dashboard, and this results in loss of data as all widget reload.
Is there someway, I can do this without reloading the dashboard?

Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants