amalgame/commit

expose proper DataTable Record-based api, so we do not need to hack the html ...

authorJacco van Ossenbruggen
Sun Aug 3 13:04:49 2014 +0200
committerJacco van Ossenbruggen
Sun Aug 3 13:04:49 2014 +0200
commitce7a48d18625039ee73183c0f9f189d6c4e17df1
tree4b4f36e60944a5d8f0c6ea4c33bc005a5d185316
parentaf5dd5315a098548b6f6fddc490eec77eaf9af53
Diff style: patch stat
diff --git a/web/js/mappingtable.js b/web/js/mappingtable.js
index cb4fe5c..9f1f769 100644
--- a/web/js/mappingtable.js
+++ b/web/js/mappingtable.js
@@ -146,6 +146,7 @@ YUI.add('mappingtable', function(Y) {
 				
 			var data = {
 					row:row,
+					selected:current,
 					sourceConcept: source,
 					targetConcept: target,
 					vocs: this.get("vocs"),
@@ -153,7 +154,8 @@ YUI.add('mappingtable', function(Y) {
 				};
 			Y.all(".yui3-datatable tr").removeClass("yui3-datatable-selected");
 			row.addClass("yui3-datatable-selected");
-			Y.log("selected correspondence in mappingtable: "+source.uri+" - "+target.uri);
+			Y.log("selected correspondence in mappingtable: "+source.uri+ " - " +target.uri);
+			Y.log(current);
 			this.fire("rowSelect", data);
 		},
 
@@ -182,13 +184,17 @@ YUI.add('mappingtable', function(Y) {
 			  },
 		nextRecord : function(row) {
 			       var next = this.nextRow(row);
-			       return id = this.table.getRecord(next.get("id"));
+			       return this.table.getRecord(next.get("id"));
 			     },
 		prevRecord : function(row) {
 			       var prev = this.prevRow(row);
 			       return this.table.getRecord(prev.get("id"));
 			     },
 			
+		addRow    : function(value)         { this.table.addRow(value); },
+		removeRow : function(record)        { this.table.removeRow(record); },
+		modifyRow : function(record, value) { this.table.modifyRow(record, value); },
+
 		_onLoadingChange : function (o) {
 			if(o.newVal) {
 				this._tableNode.addClass("hidden");