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

git at icinga.org git at icinga.org
Fri Apr 5 09:28:32 CEST 2013


Module: icinga-web
Branch: support/1.8
Commit: 6ee95317f221883d8e34536efccae1507a5992c3
URL:    https://git.icinga.org/?p=icinga-web.git;a=commit;h=6ee95317f221883d8e34536efccae1507a5992c3

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 021285d..4c50934 100644
--- a/app/modules/Cronks/lib/js/Cronk/grid/filter/Handler.js
+++ b/app/modules/Cronks/lib/js/Cronk/grid/filter/Handler.js
@@ -426,7 +426,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 dc3937e..74284f0 100755
--- 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