[Mapbender-commits] r5080 - trunk/mapbender/lib

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Tue Dec 8 07:33:55 EST 2009


Author: kmq
Date: 2009-12-08 07:33:54 -0500 (Tue, 08 Dec 2009)
New Revision: 5080

Modified:
   trunk/mapbender/lib/resultGeometryListController.js
   trunk/mapbender/lib/resultGeometryListModel.js
Log:


Modified: trunk/mapbender/lib/resultGeometryListController.js
===================================================================
--- trunk/mapbender/lib/resultGeometryListController.js	2009-12-08 12:31:20 UTC (rev 5079)
+++ trunk/mapbender/lib/resultGeometryListController.js	2009-12-08 12:33:54 UTC (rev 5080)
@@ -13,8 +13,11 @@
 	var table = table;//table;$("#"+opid).append("<table></table>");;
 
 	// the columns that should be displayed
-	var columns = [];
+	this.columns = [];
 
+	// array of buttondef objects
+	this.buttoncolumns = []
+
 	me = this;
 
 
@@ -54,13 +57,21 @@
 		// only add feature.properties enabled by wfsConf
 		for (featureIndex in featureEntryCollection.featureCollection){
 			//create array from featureEntries.feature here, using  wfsconf
-		
 			modelIndex = featureEntryCollection.featureCollection[featureIndex].index;
 			var rowData = [];
-			for (ci in columns){
-				rowData.push(me.model.getFeatureProperty(modelIndex,columns[ci]));
+			for (ci in me.columns){
+				rowData.push(me.model.getFeatureProperty(modelIndex,me.columns[ci]));
 			}
+			/*
+			// 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);
 
@@ -116,27 +127,33 @@
 	};
 	
 	this.clear = function () {
-		if (datatable) {
+		if (me.datatable) {
 			me.model.deleteFeatureCollection();	
 		}
 	};
 
 	var clear_callback = function(){
-		datatable.fnClearTable();
+		me.datatable.fnClearTable();
+		me.datatable.remove()
 	};
 
 	this.reinitialize = function(){
 	
 		
 		//create theads, and variable "labels" according to wfsConf
-		columns = getColumns(this.WFSConf);
+		me.columns = getColumns(this.WFSConf);
 		//apply columns to table
 		$("thead tr th",table).remove();
 		theads = "";
-		for(i in columns){
-			theads += "<th>"+ columns[i] +"</th>";
+		for(i in me.columns){
+			theads += "<th>"+ me.columns[i] +"</th>";
 			
 		}
+		/*
+		for (i in me.buttoncolumns){ 
+			theads += "<th>BUTTONCOLUMN</th>";
+		}
+		*/
 		$("thead tr",table).append(theads);
 
 		//

Modified: trunk/mapbender/lib/resultGeometryListModel.js
===================================================================
--- trunk/mapbender/lib/resultGeometryListModel.js	2009-12-08 12:31:20 UTC (rev 5079)
+++ trunk/mapbender/lib/resultGeometryListModel.js	2009-12-08 12:33:54 UTC (rev 5080)
@@ -177,4 +177,25 @@
 		}
 		return geomArray.get(index).e.getElementValueByName(pName);
 	};
+	
+	/**
+	 * Method: getFeature
+	 * 
+	 * Description:
+	 * Get a feature in the geometry array
+	 * 
+	 * Parameters:
+	 * index      - index of the feature
+	 */	
+	 this.getFeature = function (index) {
+		if (geomArray.count() <= index) {
+			return null;
+		}
+		return geomArray.get(index);
+	};
+
+	
+	this.toString = function(){
+		return geomArray.toString();
+	}
 };



More information about the Mapbender_commits mailing list