[Mapbender-commits] r5951 - trunk/mapbender/lib
svn_mapbender at osgeo.org
svn_mapbender at osgeo.org
Thu Apr 15 10:05:29 EDT 2010
Author: christoph
Date: 2010-04-15 10:05:27 -0400 (Thu, 15 Apr 2010)
New Revision: 5951
Modified:
trunk/mapbender/lib/resultGeometryListController.js
Log:
refactoring
Modified: trunk/mapbender/lib/resultGeometryListController.js
===================================================================
--- trunk/mapbender/lib/resultGeometryListController.js 2010-04-14 11:30:16 UTC (rev 5950)
+++ trunk/mapbender/lib/resultGeometryListController.js 2010-04-15 14:05:27 UTC (rev 5951)
@@ -21,12 +21,12 @@
this.detailColumns = [];
// array of buttondef objects
- this.rowbuttons = []
+ this.rowbuttons = [];
this.options = options;
- /*
+ /**
* Method: addFeature
* Description: adds a Feature to the Model
* Parameters:
@@ -40,7 +40,7 @@
var result = me.model.addFeature(feature);
};
- /*
+ /**
* Method: addFeatureCollection
* Description: adds a FeatureCollection to the Model
* Parameters:
@@ -50,7 +50,7 @@
var result = me.model.addFeatureCollection(geoJSON);
};
- /*
+ /**
* Method: addFeatureCollection_callback
* Description: The callback received from the Model upon successfully adding a Feature
* Parameters:
@@ -65,12 +65,10 @@
modelIndex = featureEntryCollection.featureCollection[featureIndex].index;
var rowData = [];
for (ci in me.columns){
- if(me.model.getFeatureProperty(modelIndex,me.columns[ci].name) === false) {
- var propertyValue = "";
+ var propertyValue = "";
+ if (me.model.getFeatureProperty(modelIndex,me.columns[ci].name) !== false) {
+ propertyValue = me.model.getFeatureProperty(modelIndex,me.columns[ci].name);
}
- else {
- var propertyValue = me.model.getFeatureProperty(modelIndex,me.columns[ci].name);
- }
var cellContent = '<span class="wfsFproperty">' + propertyValue + '</span>';
rowData.push(cellContent);
}
@@ -188,17 +186,20 @@
me.detailColumns = getDetailColumns(this.WFSConf);
//var buttonrow = $('#'+me.options.id +"buttonrow")
- $('#' + me.options.id +"_table_wrapper").remove()
+ $('#' + me.options.id +"_table_wrapper").remove();
- if(me.table != null){me.table.remove() }
- me.table = $('<table class="display" id="'+ me.options.id +'_table"><thead><tr></tr></thead><tbody></tbody></table>');
+ if (me.table != null) {
+ me.table.remove();
+ }
+ me.table = $('<table class="display" id="' + me.options.id +
+ '_table"><thead><tr></tr></thead><tbody></tbody></table>');
$('#' + me.options.id).prepend(me.table);
+
//apply columns to table
//$("thead tr th",table).remove();
theads = "";
for(i in me.columns){
theads += "<th>"+ me.columns[i].label +"</th>";
-
}
@@ -217,7 +218,9 @@
//}
//table.append(heads);
//table.append($("<tbody></tbody>"));
- if (me.datatable != null){ me.datatable.remove();}
+ if (me.datatable != null){
+ me.datatable.remove();
+ }
// and clear all out everythuing wtf why is there
me.datatable = me.table.dataTable({
@@ -227,11 +230,7 @@
});
$(".resultdatatable").css("clear","both");
$(".resultdatatable table").css("width","95%");
-
-
-
};
-
// initialize new
me.model = new ResultGeometryListModel();
@@ -239,6 +238,4 @@
me.model.events.deleted.register();
me.model.events.updated.register();
me.model.events.cleared.register(clear_callback);
-
-
};
More information about the Mapbender_commits
mailing list