[icinga-checkins] icinga.org: icinga-web/r1.6: * Sorting persistence

git at icinga.org git at icinga.org
Tue Dec 20 08:23:03 CET 2011


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

Author: Marius Hein <marius.hein at netways.de>
Date:   Tue Dec 20 08:21:32 2011 +0100

* Sorting persistence

---

 app/modules/Cronks/lib/js/grid/GridPanel.js |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/app/modules/Cronks/lib/js/grid/GridPanel.js b/app/modules/Cronks/lib/js/grid/GridPanel.js
index bbec529..2432fd8 100755
--- a/app/modules/Cronks/lib/js/grid/GridPanel.js
+++ b/app/modules/Cronks/lib/js/grid/GridPanel.js
@@ -257,7 +257,7 @@ Cronk.grid.GridPanel = Ext.extend(Ext.grid.GridPanel, {
         	}, this);
         }
         
-        if (Ext.isDefined(data.groupField)) {
+        if (Ext.isDefined(data.groupField) && Ext.isDefined(this.store.groupBy)) {
         	this.store.on('beforeload', function() {
 	            (function() {
 		            var dir = Ext.isEmpty(data.groupDir) ? 'ASC' : data.groupDir;
@@ -334,8 +334,9 @@ Cronk.grid.GridPanel = Ext.extend(Ext.grid.GridPanel, {
 		if (state.sortToggle) {
 			store.sortToggle = state.sortToggle;
 		}
-		if (state.sortInfo) {
-			store.sortInfo = state.sortInfo;
+		if (state.sortInfo && Ext.isDefined(state.sortInfo.field)) {
+			var direction = Ext.isDefined(state.sortInfo.direction) ? state.sortInfo.direction : 'ASC';
+			store.sort(state.sortInfo.field, state.sortInfo.direction);
 		}	
 		
 		if (state.groupOnSort) {





More information about the icinga-checkins mailing list