Forum


HomeHomePremiumPremiumDevelopmentDevelopmentConfused on how to do linking to display detail in DNN/SPA moduleConfused on how to do linking to display detail in DNN/SPA module
Previous
 
Next
New Post
11/26/2015 6:45 AM
 

I have an existing module done the "old-fashioned way" in DNN that starts with a summary view and toggles between two "detail" views.

http://www.twincitytc.org/Race-Information/Results

I thinking I'm missing something conceptually, and thus can't get this to work in an Angular module.

What I want to have happen is initially when the module is displayed I want the summary listing with the list of events. If you click on any event name I want the details for that event displayed, if you cancel out of that detail I want it to return to the summary. If you're on the event detail listing and click on a person I want the details for that person displayed, and if you click on an event on that view I want the details for that event, and a cancel takes you back to the summary.

So there's three view pages in the "old" module; Summary, EventResults, and PersonResults. What would be the right way to consolidate that to a single form SPA and be able to toggle between the three different views in the manner I was doing before?

 
New Post
11/30/2015 5:42 AM
 

I've done this before with angular modules. There are two methods I've used:
The first is to use ng-show/hide. When the user selects a event or person change a state variable on your scope. For instance $scope.shownView = 1could be used with ng-show to display a particualr view 1 being summary, 2 event, 3 person, ect.
The second way I've been doing it is using angular ui router. I've built an install package I use to add that library to my sites and reference it from my modules:

You can also include the .min in your project if you'd like to as well. No you can create 3 'states' and attach a controller and a template to each one. 

The great thing about this method is if you refresh the page it won't revert back to whatever your default is (in your case it would be summary). It's also useful for keeping your views and controllers separate which is great for keeping your coding managable and maintainable.

Hope that helps.

 
New Post
12/2/2015 1:40 PM
 

 

Great infoI Thanks so much. I will give that a try.

 
Previous
 
Next
HomeHomePremiumPremiumDevelopmentDevelopmentConfused on how to do linking to display detail in DNN/SPA moduleConfused on how to do linking to display detail in DNN/SPA module



Try FREE
30 days money back guaranteed