[icinga-checkins] icinga.org: icinga-web/r1.7: Fixes SummaryStatus links into subgrids

git at icinga.org git at icinga.org
Fri Aug 3 11:28:35 CEST 2012


Module: icinga-web
Branch: r1.7
Commit: 4e9000f4b72fef39f3a94ea1c0e1f93fc5b42c87
URL:    https://git.icinga.org/?p=icinga-web.git;a=commit;h=4e9000f4b72fef39f3a94ea1c0e1f93fc5b42c87

Author: Marius Hein <marius.hein at netways.de>
Date:   Fri Aug  3 11:28:16 2012 +0200

Fixes SummaryStatus links into subgrids

---

 app/modules/Cronks/lib/js/util/CronkUtil.js |   43 +++++++++++++++++----------
 1 files changed, 27 insertions(+), 16 deletions(-)

diff --git a/app/modules/Cronks/lib/js/util/CronkUtil.js b/app/modules/Cronks/lib/js/util/CronkUtil.js
index b180280..9ad5418 100755
--- a/app/modules/Cronks/lib/js/util/CronkUtil.js
+++ b/app/modules/Cronks/lib/js/util/CronkUtil.js
@@ -223,11 +223,19 @@ Ext.ns('Cronk.util');
 
         var pub = {
 
-            gridFilterLink: function (config, baseParams) {
+                        gridFilterLink: function (config, baseParams) {
                 var tabs = Ext.getCmp('cronk-tabs');
-                var id = config.parentid || null;
+                var id = null;
+                
+                if (!Ext.isEmpty(config.parentid)) {
+                    id = config.parentid;
+                } else if (!Ext.isEmpty(config.id)) {
+                    id = config.id;
+                }
+                
                 var panel = Ext.getCmp(id);
-                //          console.log(config);
+                var panel_component = null;
+                
                 // disable grid autoload
                 config.params.storeDisableAutoload = 1;
 
@@ -238,39 +246,42 @@ Ext.ns('Cronk.util');
                     tabs.remove(panel);
                     panel = null;
                 }
-
+                
                 if (!panel && !config.allowDuplicate) {
                     for (var i = 0; i < tabs.items.items.length; i++) {
-                        
                         var item = tabs.items.items[i];
+                        
                         if (item.cronkConfig.crname === config.crname) {
-                            panel = item;
+                            panel_component = item;
                         }
                     }
                 }
-                if (!panel) {
-                    config.id = config.parentid;
-                    panel = Cronk.factory(config);
-
-                    panel.on('add', function (p, c, i) {
+                
+                panel_component = panel;
+                
+                if (!panel_component) {
+                    config.id = id;
+                    panel_component = Cronk.factory(config);
+
+                    panel_component.on('add', function (p, c, i) {
                         applyParametersToGrid(baseParams, c);
                     });
 
                     //              console.log(baseParams);
 
-                    tabs.add(panel);
+                    tabs.add(panel_component);
                 } else {
                     // @todo is this needed?
-                    var grids = panel.findByType('cronkgrid');
+                    var grids = panel_component.findByType('cronkgrid');
                     if (grids[0]) {
                         applyParametersToGrid(baseParams, grids[0]);
                     }
                 }
 
-                panel.setTitle(config.title);
-                tabs.setActiveTab(panel);
+                panel_component.setTitle(config.title);
+                tabs.setActiveTab(panel_component);
 
-                return panel;
+                return panel_component;
             },
 
             clickGridLink: function (id, template, f, t) {





More information about the icinga-checkins mailing list