]>
Commit | Line | Data |
---|---|---|
6527f429 DM |
1 | Ext.define('ExecDashboard.view.kpi.KpiController', {\r |
2 | extend: 'Ext.app.ViewController',\r | |
3 | alias: 'controller.kpi',\r | |
4 | \r | |
5 | init: function (view) {\r | |
6 | // We provide the updater for the activeState config of our View.\r | |
7 | view.updateActiveState = this.updateActiveState.bind(this);\r | |
8 | },\r | |
9 | \r | |
10 | onToggleKpi: function(button) {\r | |
11 | if (button.pressed) {\r | |
12 | var view = this.getView();\r | |
13 | view.setActiveState(button.filter);\r | |
14 | }\r | |
15 | },\r | |
16 | \r | |
17 | updateActiveState: function (activeState) {\r | |
18 | var refs = this.getReferences();\r | |
19 | var viewModel = this.getViewModel();\r | |
20 | \r | |
21 | refs[activeState].setPressed(true);\r | |
22 | viewModel.set('kpiCategory', activeState);\r | |
23 | \r | |
24 | this.fireEvent('changeroute', this, 'kpi/' + activeState);\r | |
25 | }\r | |
26 | });\r |