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

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Wed Dec 9 08:51:55 EST 2009


Author: kmq
Date: 2009-12-09 08:51:53 -0500 (Wed, 09 Dec 2009)
New Revision: 5093

Modified:
   trunk/mapbender/http/javascripts/mod_ResultList.js
   trunk/mapbender/lib/resultGeometryListController.js
Log:
select rows onclick, and open infoPopu only when clicking on text

Modified: trunk/mapbender/http/javascripts/mod_ResultList.js
===================================================================
--- trunk/mapbender/http/javascripts/mod_ResultList.js	2009-12-09 13:33:49 UTC (rev 5092)
+++ trunk/mapbender/http/javascripts/mod_ResultList.js	2009-12-09 13:51:53 UTC (rev 5093)
@@ -40,7 +40,10 @@
 			buttondef.callback.call(this,args);
 		};
 		var button = $("<span>"+buttondef.title+"</span>").click(result);
-		$('#'+options.id).append(button);
+		if($('#'+options.id+"buttonrow").length < 1){
+			$('#'+options.id).append('<div id="'+options.id +'buttonrow"></div>');
+		}
+		$('#'+options.id +'buttonrow').append(button);
 	};
 
 	
@@ -64,15 +67,24 @@
 	//  callback = function(feature) {}
 		popupButtons.push(buttondef);
 	};
+
+	this.getSelected = function() {
+
+		var tr_rows = me.datatable.fnGetNodes;
+
+	}
 	
 	this.show = function(){
+		debugger;
 		if(display_popup){
 			$('#'+options.id).dialog("open");
 		}else{
 			$('#'+options.id).css("display","block");
 		}
-		$("tr",table).click(function(){
-			var i = $(this).data("modelindex");
+
+		$("tr td span.wfsFproperty",table).click(function(){
+			// go up to the row, which has the "modelindex" set
+			var i = $(this.parentNode.parentNode).data("modelindex");
 			var name = me.model.getFeatureProperty(i,"firstname");
 			var feature = me.model.getFeature(i);
 
@@ -90,6 +102,18 @@
 			infoPopup.append(buttonList);
 			infoPopup.dialog({autoOpen:true });
 		});
+
+		// make rows selectable
+		$("tr",table).click(function () {
+			if($(this).hasClass('row_selected')){
+				$(this).removeClass('row_selected');
+			}else{
+				$(this).addClass('row_selected');
+			}
+			return true;
+
+		});
+
 	};
 
 	this.hide = function(){

Modified: trunk/mapbender/lib/resultGeometryListController.js
===================================================================
--- trunk/mapbender/lib/resultGeometryListController.js	2009-12-09 13:33:49 UTC (rev 5092)
+++ trunk/mapbender/lib/resultGeometryListController.js	2009-12-09 13:51:53 UTC (rev 5093)
@@ -60,18 +60,10 @@
 			modelIndex = featureEntryCollection.featureCollection[featureIndex].index;
 			var rowData = [];
 			for (ci in me.columns){
-				rowData.push(me.model.getFeatureProperty(modelIndex,me.columns[ci]));
+				var cellContent = '<span class="wfsFproperty">'+ me.model.getFeatureProperty(modelIndex,me.columns[ci])+'</span>';
+				rowData.push(cellContent);
 			}
-			/*
-			// modify rowData according to me.buttoncolumns
-			for(bci in me.buttoncolumns)
-			{
-				//FIXME: honour index
-				rowData.push(me.buttoncolumns[bci].title)
 
-			}
-			*/
-
 			// fnAddData returns an array of indices
 			var index = datatable.fnAddData(rowData);
 



More information about the Mapbender_commits mailing list