[Mapbender-commits] r5991 - in trunk/mapbender: http/javascripts lib

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Wed Apr 21 05:43:11 EDT 2010


Author: verenadiewald
Date: 2010-04-21 05:43:10 -0400 (Wed, 21 Apr 2010)
New Revision: 5991

Modified:
   trunk/mapbender/http/javascripts/mod_ResultList.js
   trunk/mapbender/lib/resultGeometryListController.js
Log:
renamed var "class" to "buttonClass" for rowbuttons because IE could not handle the var name "class"

Modified: trunk/mapbender/http/javascripts/mod_ResultList.js
===================================================================
--- trunk/mapbender/http/javascripts/mod_ResultList.js	2010-04-21 08:55:08 UTC (rev 5990)
+++ trunk/mapbender/http/javascripts/mod_ResultList.js	2010-04-21 09:43:10 UTC (rev 5991)
@@ -192,8 +192,8 @@
 
 				for(bId in me.rowbuttons){
 					var callback  = me.rowbuttons[bId].callback;
-					var class = "rowbutton_" + me.rowbuttons[bId].title.replace(' ','_');
-					$("."+class, row).click(function(){
+					var buttonClass = "rowbutton_" + me.rowbuttons[bId].title.replace(' ','_');
+					$("."+buttonClass, row).click(function(){
 						callback((function(){ return row;})());
 					});
 				}

Modified: trunk/mapbender/lib/resultGeometryListController.js
===================================================================
--- trunk/mapbender/lib/resultGeometryListController.js	2010-04-21 08:55:08 UTC (rev 5990)
+++ trunk/mapbender/lib/resultGeometryListController.js	2010-04-21 09:43:10 UTC (rev 5991)
@@ -65,18 +65,20 @@
 			modelIndex = featureEntryCollection.featureCollection[featureIndex].index;
 			var rowData = [];
 			for (ci in me.columns){
-				var propertyValue = "";
-				if (me.model.getFeatureProperty(modelIndex,me.columns[ci].name) !== false) {
-					propertyValue = me.model.getFeatureProperty(modelIndex,me.columns[ci].name);
+				if(me.model.getFeatureProperty(modelIndex,me.columns[ci].name) === false) {
+					var propertyValue = "";
 				}
+				else {
+					var propertyValue = me.model.getFeatureProperty(modelIndex,me.columns[ci].name);
+				}
 				var cellContent = '<span class="wfsFproperty">' + propertyValue + '</span>';
 				rowData.push(cellContent);
 			}
 
 			for(bId in me.rowbuttons){
 				var callback  = me.rowbuttons[bId].callback;
-				var class = "rowbutton_" +  me.rowbuttons[bId].title.replace(' ','_');
-				rowData.push('<input type="button" class="'+ class +'" value="'+ me.rowbuttons[bId].title +'"  />');
+				var buttonClass = "rowbutton_" +  me.rowbuttons[bId].title.replace(' ','_');
+				rowData.push('<input type="button" class="'+ buttonClass +'" value="'+ me.rowbuttons[bId].title +'"  />');
 			}
 
 			// fnAddData returns an array of indices
@@ -114,7 +116,10 @@
 	var getColumns  = function(WfsConf){
 		if (!WfsConf) { return []; }
 		var currentWfsConf = WfsConf;
-		var labelArray = [];
+//		var labelArray = [];
+		var labelArray = [null,null,null,null,null,null,null,null,
+		                  null,null,null,null,null,null,null,null,
+		                  null,null,null,null];
 		for (var j = 0 ; j < currentWfsConf.element.length ; j++) {
 			if(currentWfsConf.element[j].f_show == 1 && currentWfsConf.element[j].f_label!==''){
 				var labelPos = currentWfsConf.element[j].f_respos;
@@ -126,7 +131,7 @@
 		}
 		resultArray = [];
 		for (index in labelArray){
-			if (labelArray[index]  !== undefined){
+			if (labelArray[index]  !== undefined && labelArray[index]  !== null){
 				resultArray.push(labelArray[index]);
 			}
 		}
@@ -136,7 +141,10 @@
 	var getDetailColumns  = function(WfsConf){
 		if (!WfsConf) { return []; }
 		var currentWfsConf = WfsConf;
-		var labelArray = [];
+//		var labelArray = [];
+		var labelArray = [null,null,null,null,null,null,null,null,
+		                  null,null,null,null,null,null,null,null,
+		                  null,null,null,null];
 		for (var j = 0 ; j < currentWfsConf.element.length ; j++) {
 			if(currentWfsConf.element[j].f_show_detail == 1) {
 				var labelPos = currentWfsConf.element[j].f_detailpos;
@@ -148,7 +156,7 @@
 		}
 		resultArray = [];
 		for (index in labelArray){
-			if (labelArray[index]  !== undefined){
+			if (labelArray[index]  !== undefined && labelArray[index]  !== null){
 				resultArray.push(labelArray[index]);
 			}
 		}



More information about the Mapbender_commits mailing list