[icinga-checkins] icinga.org: icinga-web/next: Filter disappears after safe cronk

git at icinga.org git at icinga.org
Fri Apr 5 09:27:33 CEST 2013


Module: icinga-web
Branch: next
Commit: 914775bbfdacce4939dbbb591a9dda941cf66cc1
URL:    https://git.icinga.org/?p=icinga-web.git;a=commit;h=914775bbfdacce4939dbbb591a9dda941cf66cc1

Author: Marius Hein <marius.hein at netways.de>
Date:   Thu Apr  4 18:20:18 2013 +0200

Filter disappears after safe cronk

Problem is not deterministic, components and setters
work correctly. Set the value after rendering reduces
errors but does not fix. Seems that ext component
is gone.

refs #3926

---

 .../Cronks/lib/js/Cronk/grid/filter/Handler.js     |    1 -
 .../Cronks/lib/js/Cronk/grid/filter/Window.js      |   16 ++++++----------
 2 files changed, 6 insertions(+), 11 deletions(-)

diff --git a/app/modules/Cronks/lib/js/Cronk/grid/filter/Handler.js b/app/modules/Cronks/lib/js/Cronk/grid/filter/Handler.js
index 6ed7482..67859e8 100644
--- a/app/modules/Cronks/lib/js/Cronk/grid/filter/Handler.js
+++ b/app/modules/Cronks/lib/js/Cronk/grid/filter/Handler.js
@@ -427,7 +427,6 @@ Ext.ns('Cronk.grid.filter');
                 this.getOperatorComponent(meta),
                 this.getFilterComponent(meta),
                 this.getRemoveComponent(meta)]);
-
             }
 
             // All panels there
diff --git a/app/modules/Cronks/lib/js/Cronk/grid/filter/Window.js b/app/modules/Cronks/lib/js/Cronk/grid/filter/Window.js
index 161a971..3ebbc98 100644
--- a/app/modules/Cronks/lib/js/Cronk/grid/filter/Window.js
+++ b/app/modules/Cronks/lib/js/Cronk/grid/filter/Window.js
@@ -126,7 +126,6 @@ Ext.ns('Cronk.util');
                         render: function (oc) {
 
                             if (oGrid.filter_types) {
-                                AppKit.log(oGrid.filter_types);
                                 var i = 0;
 
                                 Ext.iterate(oGrid.filter_types, function (key, item) {
@@ -150,19 +149,17 @@ Ext.ns('Cronk.util');
 
                             if (oGrid.filter_params && oCoPanel) {
                                 Ext.iterate(oGrid.filter_params, function (key, val) {
-                                    //                              console.log(key + ": " + val);
                                     key = key.replace(/^f\[|\]$/g, "");
                                     var c = oCoPanel.findBy(function (ti) {
-
-                                        if (ti.hiddenName === key || ti.name === key) {
-                                            return true;
-                                        }
-
-                                        return false;
+                                        return ti.hiddenName === key || ti.name === key;
                                     });
 
                                     if (c[0]) {
-                                        c[0].setValue(val);
+                                        // Set value as String (cause of ===)
+                                        // and after component is rendered ready
+                                        c[0].on('afterrender', function() {
+                                            c[0].setValue(String(val));
+                                        }, c[0], {single:true});
                                     }
                                 });
                             }
@@ -500,7 +497,6 @@ Ext.ns('Cronk.util');
              */
             applyFilters: function (owd) {
                 var data = owd || getFormValues();
-
                 oGrid.getStore().baseParams = {};
                 Ext.apply(oGrid.getStore().baseParams, oOrgBaseParams);
                 Ext.apply(oGrid.getStore().baseParams, data);





More information about the icinga-checkins mailing list