Statistics
| Branch: | Tag: | Revision:

root / snf-cyclades-app / synnefo / ui / new_ui / ui / javascripts / ember / routes / networks.js @ e4a6c3b8

History | View | Annotate | Download (726 Bytes)

1
App.NetworksRoute = Ember.Route.extend({
2
    
3
    model: function(params){
4
              this.set( 'viewCls', params.view_cls );
5
              var controller = this.get("controller");
6

    
7
              // Ember checks if controller is already set, and if so, does not set it
8
              // up again. Hence, the following hack:
9
              if (controller) {
10
                      controller.set("viewCls", params.view_cls);
11
              }
12

    
13
              // end of hack
14
              return this.store.find('network');
15
    },
16
    renderTemplate: function() {
17
        this.render('items');
18
    },
19

    
20
    setupController: function(controller, model) {
21
                   controller.set('model', model);
22
                   controller.set("viewCls", this.get("viewCls"));
23
      controller.set('modelName', 'network');
24
           },
25

    
26
});