Hi skar,

to accomplish this I guess you'd have to calculate the total height the 
table would need to display its content and then set the table widget's 
height to that value.
You can get the table's rowHeight and multiply that with the table 
model's rowCount, then add the table's headerCellHeight. If your table 
has a statusBar, you could access it through the table's _getChildren() 
method, get its height using the getSizeHint() method and add that as well.

Only problem is, there's some empty space below the table's last row. I 
have no idea how or where its height is calculated or how to access it. 
I simply added another 24 pixels to the table height but YMMV.

Here's the code I just hacked up:

/*...*/
tableModel.addListener("dataChanged", this.setTableSize, this);
this.table.addListener("appear", this.setTableSize, this);
/*...*/

     setTableSize : function(ev)
     {
       var model = this.table.getTableModel();
       var tableHeight = (model.getRowCount() * 
this.table.getRowHeight()) + this.table.getHeaderCellHeight();
       // get the status bar's height
       var tableChildren = this.table._getChildren();
       for (var i = 0, l = tableChildren.length; i < l; i++) {
         if (tableChildren[i].classname == "qx.ui.basic.Label") {
           var childHeight = tableChildren[i].getSizeHint().height
           tableHeight += childHeight;
         }
       }

       this.table.setHeight(tableHeight + 24);
     }


Regards,
Daniel


skar schrieb:
> Hi,
> 
> I've got a table inside a composite container which is inside a scroll
> container. The composite container's min height is 600. Now, when I
> display 50 rows, the scroll container's vertical scroll as well as the
> table's vertical scroll are both active and I need to use both the
> scroll's to reach a particular row. What I'd like is to have the table
> grow enough to display all the 50 rows without it's vertical scroll and
> for the scroll container's vscroll alone to be used to scroll down the
> app. Any ideas on how to do this?
> 
> cheers,
> skar.
> 

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to