[icinga-checkins] icinga.org: icinga-web/cdoebler/default: * Made filter persistent

git at icinga.org git at icinga.org
Thu Jan 28 15:06:07 CET 2010


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

Author: Marius Hein <mhein at sasquatch.local.itsocks.de>
Date:   Tue Jan 26 16:44:50 2010 +0100

* Made filter persistent

---

 .../System/ViewProc/js/IcingaGridFilterHandler.js  |    4 +++
 lib/appkit/js/ext/grid/MetaGridCreator.js          |   29 +++++++++++++++++++-
 2 files changed, 32 insertions(+), 1 deletions(-)

diff --git a/app/modules/Cronks/templates/System/ViewProc/js/IcingaGridFilterHandler.js b/app/modules/Cronks/templates/System/ViewProc/js/IcingaGridFilterHandler.js
index cbc4b53..d7ec81d 100644
--- a/app/modules/Cronks/templates/System/ViewProc/js/IcingaGridFilterHandler.js
+++ b/app/modules/Cronks/templates/System/ViewProc/js/IcingaGridFilterHandler.js
@@ -257,7 +257,11 @@ var IcingaGridFilterWindow = function() {
 			Ext.apply(oGrid.getStore().baseParams, oOrgBaseParams);
 			Ext.apply(oGrid.getStore().baseParams, data);
 			
+//			console.log('APPLY');
+//			console.log(oGrid.getStore().baseParams);
+			
 			oGrid.getStore().reload();
+			oGrid.fireEvent('activate');
 			
 			oWindow().hide();
 		},
diff --git a/configure b/configure
old mode 100644
new mode 100755
diff --git a/lib/appkit/js/ext/grid/MetaGridCreator.js b/lib/appkit/js/ext/grid/MetaGridCreator.js
index c875d47..90f99ac 100644
--- a/lib/appkit/js/ext/grid/MetaGridCreator.js
+++ b/lib/appkit/js/ext/grid/MetaGridCreator.js
@@ -137,7 +137,34 @@ AppKit.Ext.grid.MetaGridCreator.prototype = {
 		if (this.stateuid) {
 			Ext.apply(grid_config, {
 				stateful: true,
-				stateId: this.stateuid
+				stateId: this.stateuid,
+				stateEvents: ['activate'],
+				
+				getState: function() {
+					
+//					console.log('GET STATE');
+//					console.log(this.getStore().baseParams);
+					
+					return {
+						params: this.getStore().baseParams
+					};
+				},
+				
+				applyState: function(state) {
+					
+					if (state.params) {
+						this.getStore().baseParams = {};
+						Ext.apply(this.getStore().baseParams, state.params);
+						
+						this.getStore().on('load', function() {
+							this.reload();
+						}, null, { single: true } );
+						
+						return true;
+					}
+					
+					return true;
+				}
 			});
 		}
 		





More information about the icinga-checkins mailing list