Just an update to my post before. You can find a more complex demo in our demo 
browser as well (shows you how to use min / max width of a column as well)

http://demo.qooxdoo.org/current/demobrowser/#table~Table_Resize_Columns.html

Tino


Am 10.12.2010 um 17:04 schrieb Tino Butz:

> Hi Omri,
> 
> I don't think it is possible to determine the width of a column based on it's 
> content by the framework. The performance of a huge table would be decreased.
> Another way is to use a flex value for the columns, that have long texts 
> inside. By doing this the table divides the available space between the flex 
> columns.
> 
> I wrote you a little example for this:
> 
> http://demo.qooxdoo.org/current/playground/#%7B%22code%22%3A%20%22%252F%252F%2520table%2520model%250Avar%2520tableModel%2520%253D%2520new%2520qx.ui.table.model.Simple()%253B%250AtableModel.setColumns(%255B%2522ID%2522%252C%2520%2522A%2520number%2522%252C%2520%2522String%2522%255D)%253B%250AtableModel.setData(%255B%255B1%252C%252012.23%252C%2520%2522bla%2522%255D%252C%255B3%252C%2520849759438750%252C%2520%2522blub%2522%255D%252C%255B2%252C%2520-2%252C%2520%2522foo%2522%255D%255D)%253B%250A%250A%252F%252F%2520table%250Avar%2520table%2520%253D%2520new%2520qx.ui.table.Table(tableModel%252C%2520%257BtableColumnModel%253Afunction(table)%2520%257B%250A%2520%2520return%2520new%2520qx.ui.table.columnmodel.Resize(table)%253B%250A%257D%257D)%253B%250A%250A%250Atable.setWidth(500)%253B%250Athis.getRoot().add(table)%253B%250A%250Avar%2520columnModel%2520%253D%2520table.getTableColumnModel()%253B%250A%252F%252FcolumnModel.getBehavior().setWidth(0%252C%25222*%2522)%253B%250A%252F%252FcolumnModel.getBehavior().setWidth(0%252C%252250%2525%2522)%253B%250AcolumnModel.getBehavior().setWidth(0%252C50)%253B%250A%22%7D
> 
> 
> By using the resize table column model you can set the sices of a column in 
> the following different ways:
> 
> //columnModel.getBehavior().setWidth(0,"2*"); // flex
> //columnModel.getBehavior().setWidth(0,"50%"); // percent
> columnModel.getBehavior().setWidth(0,50); // absolute
> 
> For the resizing of the table columns by double click you might want to add 
> an enhancement bug in the qooxdoo bugzilla:
> 
> http://bugzilla.qooxdoo.org
> 
> 
> Have fun,
> Tino
> 
> 
> Am 10.12.2010 um 15:22 schrieb omrihar:
> 
>> 
>> Hey Qooxdoo community and developers,
>> 
>> first I would like to say congrats for the new release! Keep up the good
>> work :)
>> 
>> Second my question - I have a table (not very big) which has entries with a
>> variable length of strings and I was wondering if there is a way to
>> understand what is the minimal width required of a column so that it
>> displays the entire strings in all its rows? 
>> I would like basically to divide the width between the columns as
>> effectively as possible, so that at least most of the content will be shown.
>> Also a functionality suggestion would be to add the ability to resize on
>> double-click on the interface between neighboring columns.
>> 
>> Thanks!
>> Omri
>> -- 
>> View this message in context: 
>> http://qooxdoo.678.n2.nabble.com/Controlling-Column-Sizes-in-the-Table-widget-tp5823201p5823201.html
>> Sent from the qooxdoo mailing list archive at Nabble.com.
>> 
>> ------------------------------------------------------------------------------
>> _______________________________________________
>> qooxdoo-devel mailing list
>> [email protected]
>> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
> 
> Tino Butz
> Mobile Architect
> 
> 1&1 Internet AG - Web Technologies
> Ernst-Frey-Straße 9 · DE-76135 Karlsruhe
> Telefon: +49 721 91374-4488
> [email protected]
> 
> Amtsgericht Montabaur / HRB 6484
> Vorstände: Henning Ahlert, Ralph Dommermuth, Matthias Ehrlich, Thomas 
> Gottschlich, Robert Hoffmann, Markus Huhn, Hans-Henning Kettler, Dr. Oliver 
> Mauss, Jan Oetjen
> Aufsichtsratsvorsitzender: Michael Scheeren
> 
> 
> ------------------------------------------------------------------------------
> Oracle to DB2 Conversion Guide: Learn learn about native support for PL/SQL,
> new data types, scalar functions, improved concurrency, built-in packages, 
> OCI, SQL*Plus, data movement tools, best practices and more.
> http://p.sf.net/sfu/oracle-sfdev2dev 
> _______________________________________________
> qooxdoo-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Tino Butz
Mobile Architect

1&1 Internet AG - Web Technologies
Ernst-Frey-Straße 9 · DE-76135 Karlsruhe
Telefon: +49 721 91374-4488
[email protected]

Amtsgericht Montabaur / HRB 6484
Vorstände: Henning Ahlert, Ralph Dommermuth, Matthias Ehrlich, Thomas 
Gottschlich, Robert Hoffmann, Markus Huhn, Hans-Henning Kettler, Dr. Oliver 
Mauss, Jan Oetjen
Aufsichtsratsvorsitzender: Michael Scheeren


------------------------------------------------------------------------------
Oracle to DB2 Conversion Guide: Learn learn about native support for PL/SQL,
new data types, scalar functions, improved concurrency, built-in packages, 
OCI, SQL*Plus, data movement tools, best practices and more.
http://p.sf.net/sfu/oracle-sfdev2dev 
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to