[icinga-checkins] icinga.org: icinga-web/master: * Fixed filters not being saved ( did anyone notice? :) )

git at icinga.org git at icinga.org
Fri Sep 24 15:14:03 CEST 2010


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

Author: jmosshammer <jmosshammer at ws-jmosshammer.(none)>
Date:   Fri Sep 24 15:13:15 2010 +0200

* Fixed filters not being saved (did anyone notice? :) )

---

 app/modules/Cronks/lib/js/grid/MetaGridCreator.js  |   14 ++++++++------
 .../System/ViewProc/js/IcingaGridFilterHandler.js  |   13 +++++++++++--
 2 files changed, 19 insertions(+), 8 deletions(-)

diff --git a/app/modules/Cronks/lib/js/grid/MetaGridCreator.js b/app/modules/Cronks/lib/js/grid/MetaGridCreator.js
index 2338fc7..8d227c4 100755
--- a/app/modules/Cronks/lib/js/grid/MetaGridCreator.js
+++ b/app/modules/Cronks/lib/js/grid/MetaGridCreator.js
@@ -270,14 +270,15 @@ Cronk.grid.MetaGridCreator = function(meta) {
 				
 				getState: function() {
 					var store = this.getStore();
+				
 					var o = {
-						filter_params: pub.filter_params || {},
-						filter_types: pub.filter_types || {},
+						filter_params: this.filter_params || {},
+						filter_types: this.filter_types || {},
 						store_origin_params: ("originParams" in store) ? store.originParams : {}
 					};
 					
 					var e = true;
-					
+
 					for (var i in o.filter_params) { e=false; break; }
 					for (var i in o.filter_types) { e=false; break; }
 					for (var i in o.store_origin_params) { e=false; break; }
@@ -292,7 +293,7 @@ Cronk.grid.MetaGridCreator = function(meta) {
 					var store = this.getStore();
 					
 					if (state.filter_types) {
-						pub.filter_types = state.filter_types;
+						this.filter_types =  pub.filter_types = state.filter_types;
 					}
 					
 					if (state.store_origin_params) {
@@ -301,8 +302,9 @@ Cronk.grid.MetaGridCreator = function(meta) {
 					}
 					
 					if (state.filter_params) {
-						pub.filter_params = state.filter_params;
-						pub.applyParamsToStore(pub.filter_params, store) && (!reload && (reload=true));
+						this.filter_params = pub.filter_params = state.filter_params;
+						
+						pub.applyParamsToStore(this.filter_params, store) && (!reload && (reload=true));
 					}
 					
 					(reload == true) && (store.reload());
diff --git a/app/modules/Cronks/templates/System/ViewProc/js/IcingaGridFilterHandler.js b/app/modules/Cronks/templates/System/ViewProc/js/IcingaGridFilterHandler.js
index 9b31afc..426d0e5 100755
--- a/app/modules/Cronks/templates/System/ViewProc/js/IcingaGridFilterHandler.js
+++ b/app/modules/Cronks/templates/System/ViewProc/js/IcingaGridFilterHandler.js
@@ -62,10 +62,13 @@ Cronk.util.GridFilterWindow = function() {
 					
 					listeners: {
 						render: function(oc) {
+							AppKit.log(oGrid);
 							if (oGrid.filter_types) {
 								var i = 0;
+
 								Ext.iterate(oGrid.filter_types, function(key, item) {
 									var r = new Ext.data.Record(item);
+									
 									selectRestrictionHandler(oCombo, r, i);
 									i++;
 								})
@@ -238,8 +241,13 @@ Cronk.util.GridFilterWindow = function() {
 		}
 		
 		function getFormValues(raw) {
-			var data = oCoPanel.getForm().getValues();
-			
+			AppKit.log( oCoPanel.getForm());
+			var data = {}
+			try {
+				data = oCoPanel.getForm().getValues();
+			} catch(e) {
+				data = {}
+			}
 			var o = {};
 			
 			for (var k in data) {
@@ -285,6 +293,7 @@ Cronk.util.GridFilterWindow = function() {
 				}
 				
 				oGrid.on('activate', function() {
+	
 					if (oCoPanel) {
 						oGrid.filter_params = getFormValues(false);
 					}





More information about the icinga-checkins mailing list