incubator-xap-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jmarga...@apache.org
Subject svn commit: r508154 - /incubator/xap/trunk/codebase/src/xap/widgets/dojo/TreeTable.js
Date Thu, 15 Feb 2007 21:19:39 GMT
Author: jmargaris
Date: Thu Feb 15 13:19:38 2007
New Revision: 508154

URL: http://svn.apache.org/viewvc?view=rev&rev=508154
Log:
xa-311 fix, array insert element no longer accepts -1
as an index

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

Modified: incubator/xap/trunk/codebase/src/xap/widgets/dojo/TreeTable.js
URL: http://svn.apache.org/viewvc/incubator/xap/trunk/codebase/src/xap/widgets/dojo/TreeTable.js?view=diff&rev=508154&r1=508153&r2=508154
==============================================================================
--- incubator/xap/trunk/codebase/src/xap/widgets/dojo/TreeTable.js (original)
+++ incubator/xap/trunk/codebase/src/xap/widgets/dojo/TreeTable.js Thu Feb 15 13:19:38 2007
@@ -406,8 +406,13 @@
 	 
 	insertColumn: function(column, index){
 		column.setTable(this);
-		xap.util.ArrayHelper.insertElementAt(this._columns,column,index);
 		
+		if (index && index>=0){
+			xap.util.ArrayHelper.insertElementAt(this._columns,column,index);		
+		}
+		else{
+			this._columns.push(column);
+		}
 		//TODO we should really be able to make this
 		//more efficient by inserting the column in place
 	},
@@ -420,7 +425,12 @@
 	
 	//index here is relative to parent row?
 	insertRow: function(row, index){
-		xap.util.ArrayHelper.insertElementAt(this._rows,row,index);		
+		if (index && index>=0){
+			xap.util.ArrayHelper.insertElementAt(this._rows,row,index);		
+		}
+		else{
+			this._rows.push(row);
+		}
 		//call _rowAdded because row can have child rows
 		this._rowAdded(row);
 	},
@@ -827,7 +837,13 @@
 	},
 	
 	insertRow: function(row, index){
-		xap.util.ArrayHelper.insertElementAt(this._rows,row,index);
+		if (index && index>=0){
+			xap.util.ArrayHelper.insertElementAt(this._rows,row,index);		
+		}
+		else{
+			this._rows.push(row);
+		}
+		
 		if (this._table){
 			this._table._rowAdded(row);
 		}



Mime
View raw message