You are viewing a plain text version of this content. The canonical link for it is here.
Posted to xap-commits@incubator.apache.org by jm...@apache.org on 2007/01/06 01:53:34 UTC

svn commit: r493269 - in /incubator/xap/trunk/src/xap: bridges/dojo/RowBridge.js widgets/dojo/TreeTable.js

Author: jmargaris
Date: Fri Jan  5 17:53:34 2007
New Revision: 493269

URL: http://svn.apache.org/viewvc?view=rev&rev=493269
Log:
removing a row from a parent row should work better now

Modified:
    incubator/xap/trunk/src/xap/bridges/dojo/RowBridge.js
    incubator/xap/trunk/src/xap/widgets/dojo/TreeTable.js

Modified: incubator/xap/trunk/src/xap/bridges/dojo/RowBridge.js
URL: http://svn.apache.org/viewvc/incubator/xap/trunk/src/xap/bridges/dojo/RowBridge.js?view=diff&rev=493269&r1=493268&r2=493269
==============================================================================
--- incubator/xap/trunk/src/xap/bridges/dojo/RowBridge.js (original)
+++ incubator/xap/trunk/src/xap/bridges/dojo/RowBridge.js Fri Jan  5 17:53:34 2007
@@ -66,6 +66,14 @@
 	this.getPeer().setExpanded(value=="true");
 }	
 
+
+xap.bridges.dojo.RowBridge.prototype.removeChild = function(childHandler, index){
+	if (childHandler.getPeer() instanceof xap.widgets.dojo.TableRow){
+		this.getPeer().removeRow(childHandler.getPeer());
+	}
+	//TODO remove cells!!!
+}
+
 xap.bridges.dojo.RowBridge.prototype.addChild = function(childHandler, index){
 	if (childHandler.getPeer() instanceof xap.widgets.dojo.TableRow){
 		this.getPeer().insertRow(childHandler.getPeer(),index);

Modified: incubator/xap/trunk/src/xap/widgets/dojo/TreeTable.js
URL: http://svn.apache.org/viewvc/incubator/xap/trunk/src/xap/widgets/dojo/TreeTable.js?view=diff&rev=493269&r1=493268&r2=493269
==============================================================================
--- incubator/xap/trunk/src/xap/widgets/dojo/TreeTable.js (original)
+++ incubator/xap/trunk/src/xap/widgets/dojo/TreeTable.js Fri Jan  5 17:53:34 2007
@@ -826,6 +826,19 @@
 			this._adjustImage();
 		}
 		//after inserting a row we need to add the row to the parent table	
+	},
+	
+	
+	removeRow: function(row){
+		xap.util.ArrayHelper.removeElement (this._rows,row);
+		if (this._table){
+			this._table._rowRemoved(row);
+		}
+		
+		//after removing the last child we need to adjust +/- icon
+		if (this._rows.length==0){
+			this._adjustImage();
+		}
 	}	
 	
 });