From xap-commits-return-1424-apmail-incubator-xap-commits-archive=incubator.apache.org@incubator.apache.org Tue Jun 05 02:06:54 2007 Return-Path: Delivered-To: apmail-incubator-xap-commits-archive@locus.apache.org Received: (qmail 59162 invoked from network); 5 Jun 2007 02:06:50 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 5 Jun 2007 02:06:50 -0000 Received: (qmail 88668 invoked by uid 500); 5 Jun 2007 02:06:53 -0000 Delivered-To: apmail-incubator-xap-commits-archive@incubator.apache.org Received: (qmail 88642 invoked by uid 500); 5 Jun 2007 02:06:53 -0000 Mailing-List: contact xap-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: xap-dev@incubator.apache.org Delivered-To: mailing list xap-commits@incubator.apache.org Received: (qmail 88618 invoked by uid 99); 5 Jun 2007 02:06:52 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 04 Jun 2007 19:06:52 -0700 X-ASF-Spam-Status: No, hits=-99.5 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO eris.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 04 Jun 2007 19:06:45 -0700 Received: by eris.apache.org (Postfix, from userid 65534) id 2FF481A981A; Mon, 4 Jun 2007 19:06:25 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r544343 - in /incubator/xap/trunk/codebase/src/xap: bridges/dojo/TableBridge.js widgets/dojo/TreeTable.js Date: Tue, 05 Jun 2007 02:06:24 -0000 To: xap-commits@incubator.apache.org From: mturyn@apache.org X-Mailer: svnmailer-1.1.0 Message-Id: <20070605020625.2FF481A981A@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: mturyn Date: Mon Jun 4 19:06:23 2007 New Revision: 544343 URL: http://svn.apache.org/viewvc?view=rev&rev=544343 Log: Reverting versions TableBride.js > March 19, 2007 TreeTable.js > April 4, 2007 Modified: incubator/xap/trunk/codebase/src/xap/bridges/dojo/TableBridge.js incubator/xap/trunk/codebase/src/xap/widgets/dojo/TreeTable.js Modified: incubator/xap/trunk/codebase/src/xap/bridges/dojo/TableBridge.js URL: http://svn.apache.org/viewvc/incubator/xap/trunk/codebase/src/xap/bridges/dojo/TableBridge.js?view=diff&rev=544343&r1=544342&r2=544343 ============================================================================== --- incubator/xap/trunk/codebase/src/xap/bridges/dojo/TableBridge.js (original) +++ incubator/xap/trunk/codebase/src/xap/bridges/dojo/TableBridge.js Mon Jun 4 19:06:23 2007 @@ -27,8 +27,7 @@ Xap.require("xap.bridges.dojo.DojoWidgetBridge"); Xap.require("xap.widgets.dojo.TreeTable"); -Xap.require("dojo.html"); -Xap.require("xap.util.CssUtils"); + /** @@ -39,10 +38,13 @@ xap.bridges.dojo.TableBridge= function() { xap.bridges.dojo.DojoWidgetBridge.call(this); -}; +} -Xap.setupClassAsSubclassOf("xap.bridges.dojo.TableBridge", "xap.bridges.dojo.DojoWidgetBridge"); +Xap.setupClassAsSubclassOf( + "xap.bridges.dojo.TableBridge", + "xap.bridges.dojo.DojoWidgetBridge" +); @@ -51,41 +53,18 @@ dojo.event.connect(this.getPeer(), "onActivateRow",this,"onActivateRow"); dojo.event.connect(this.getPeer(), "onSelectRow",this,"onSelectRow"); dojo.event.connect(this.getPeer(), "onDeselectRow",this,"onDeselectRow"); - dojo.event.connect(this.getPeer(), "onExpandRow",this,"onExpandRow"); - -}; - + dojo.event.connect(this.getPeer(), "onExpandRow",this,"onExpandRow"); +} xap.bridges.dojo.TableBridge.prototype.getPeerString = function(){ return "TreeTable" ; -}; - - -xap.bridges.dojo.TableBridge.prototype.obtainPeer = function(){ - xap.bridges.dojo.TableBridge.superclass.obtainPeer.call(this) ; - var peer = this.getPeer() ; - if( !peer._tableLayoutModel){ - peer._tableLayoutModel = {} ; - } - var h = this.getElement().getAttribute("height") ; - if( h ){ - peer._tableLayoutModel.initialHeight = h ; - } - var w = this.getElement().getAttribute("width") ; - if( w ){ - peer._tableLayoutModel.initialWidth = w ; - } -}; - - - +} xap.bridges.dojo.TableBridge.prototype.onActivateRow = function( a ){ var clientEvent = new xap.session.ClientEvent(this.getElement(), this.getSession()); clientEvent.rowId = this.getSelectedRowIds(); this.fireEvent("onSelect", null, null, clientEvent); -}; - +} xap.bridges.dojo.TableBridge.prototype.onExpandRow = function( row, expanded ){ var handler = this.getUiContentHandler().getHandlerForPeer(row); @@ -93,14 +72,13 @@ var clientEvent = new xap.session.ClientEvent(this.getElement(), this.getSession()); clientEvent.rowId = handler.getElement().getAttribute("id"); this.fireEvent(expanded?"onExpand":"onCollapse", null, null, clientEvent); -}; +} xap.bridges.dojo.TableBridge.prototype.onDeselectRow = function( row ){ var handler = this.getUiContentHandler().getHandlerForPeer(row); handler.writeBackRemoveAttribute("selected"); -}; - +} xap.bridges.dojo.TableBridge.prototype.onSelectRow = function( row ){ var handler = this.getUiContentHandler().getHandlerForPeer(row); @@ -108,8 +86,7 @@ var clientEvent = new xap.session.ClientEvent(this.getElement(), this.getSession()); clientEvent.rowId = this.getSelectedRowIds(); this.fireEvent("onStateChange", null, null, clientEvent); -}; - +} xap.bridges.dojo.TableBridge.prototype.getSelectedRowIds = function(){ var s = ""; @@ -117,15 +94,15 @@ for (var i=0; i' - + '
' - + '
' - + '' - + '' - + '' - + '' - + '
' - + '
' - + '
' - + '' - + '' - + '' - + '
' - + '
' -+ '', - - + templateString: '
' + + '
' + + '
'+ + '
' + + '
', templateCssPath: null , widgetType: "TreeTable", isContainer: false, defaultCellInfo: {_text:""}, - // Delay between setting height or width and - // resetting scrollDiv overflow back to "auto" - // (previously set to "hidden" at the start - // of setHeight() or setWidth()): - _resetScrollDivDelayMs: (dojo.render.html.moz)?0:0, - // Delay between resetting scrollDiv overflow - // back to "auto" and checking to see the results of that: - _finishScrollDivDelayMs: (dojo.render.html.moz)?0:100, - -// Debugging -// _ctr:-1 , -// loggit: function(aString){ -// Xap.logString+="^"+(++this._ctr) -// +"\t"+aString+"\t"; -// if(this.table){ -// Xap.logString -// +=this.table.clientWidth +"\t"+this.domNode.clientWidth ; -// } -// }, - - postCreate: function(){ //debug::this.loggit('postCreate') ; - xap.widgets.dojo.TreeTable.superclass.postCreate.apply(this,arguments) ; - this._created = true ; - if( !this._tableLayoutModel ){ - this._tableLayoutModel = {} ; - } -// debugging: -// window.foo = this ; - }, - - - /** * * @@ -142,19 +86,18 @@ /** * Rebuild just the rows of the table, typically called after sorting. */ - _rebuildRowsLater : function(delay){ //debug::this.loggit('_rebuildRowsLater ') ; + _rebuildRowsLater : function(){ //if a full rebuild is pending don't bother if (!this._rebuildTableTask && !this._rebuildRowsTask){ - var theDelay = delay || 0 ; - this._rebuildRowsTask = dojo.lang.setTimeout(this, this._rebuildRows, delay); + this._rebuildRowsTask = dojo.lang.setTimeout(this, this._rebuildRows, 0); } }, /** * Rebuilds the entire table from scratch, should be a very rare occurence. */ - _rebuildTableLater: function(delay){ //debug::this.loggit('_rebuildTableLater') ; + _rebuildTableLater: function(){ //cancel any partial rebuild tasks if (this._rebuildRowsTask){ @@ -167,9 +110,8 @@ } //if not already scheduled then schedule it - var theDelay = delay || 0 ; if (!this._rebuildTableTask){ - this._rebuildTableTask = dojo.lang.setTimeout(this, this._rebuildTable, theDelay); + this._rebuildTableTask = dojo.lang.setTimeout(this, this._rebuildTable, 0); } }, @@ -177,13 +119,13 @@ * Once the table is built/sized run through * and make sure headers and column widths agree */ - _resizeTableLater: function(){ //debug::this.loggit('_resizeTableLater') ; + _resizeTableLater: function(){ if (!this._resizeTableTask){ this._resizeTableTask = dojo.lang.setTimeout(this, this._resizeTable, 0); } }, - _getSizeFromString: function(val){ //debug::this.loggit('_getSizeFromString') ; + _getSizeFromString: function(val){ var s = new String(val); var i = s.search ("px"); if ( i > 0 ) return Number(s.substr(0,i)); @@ -195,38 +137,15 @@ * After a table has been built to the screen go through and make sure * the widths of columns and headers match up. */ - _resizeTable: function(){ //debug::this.loggit('_resizeTable') ; + _resizeTable: function(){ var tableWidth = 0; - + //don't user tbody.childNodes[0] here because in the case //where we need to fix up IE we want to fixup and THEN remove //and re-add rows in the new order. var firstRow = this._rows.length>0?this._rows[0].domNode:null; - // Spacing gets screwed-up under IE if the first row isn't complete, - // so complete it if need be: - var len = -1 ; - if( dojo.render.html.ie - && firstRow - && this._columns - && (len=this._columns.length)>1 - ){ - while(firstRow.childNodes.length