Discussion:
qx.ui.table.Table, qx.ui.table.model.Simple column width
(too old to reply)
Peter Caffin
2016-07-12 07:55:34 UTC
Permalink
Hi guys,

Hopefully a simple one.

I'm building a table with the following:

AModel = new qx.ui.table.model.Simple();
AModel.setColumns(["Method","Company","Info"]);
A = new qx.ui.table.Table(T1231Model);
myframe.add(A,{row:1,column:0,rowSpan:20});
A.set({height:200});
A.setStatusBarVisible(false);

The result is three columns of equal default width. I'd like the widths
of the three columns to be set to different values, so the user doesn't
have to manually drag them to the right size.

I can't see anything in the doco. How do I do that?

Thanks.
Derrell Lipman
2016-07-12 15:04:57 UTC
Permalink
Hi Peter. The secret is to use the Resize table column model instead of the
default, Basic table column model. See the example in the following link:

http://qooxdoo.678.n2.nabble.com/Controlling-Column-Sizes-in-the-Table-widget-td5823201.html

Cheers,

Derrell
Post by Peter Caffin
Hi guys,
Hopefully a simple one.
AModel = new qx.ui.table.model.Simple();
AModel.setColumns(["Method","Company","Info"]);
A = new qx.ui.table.Table(T1231Model);
myframe.add(A,{row:1,column:0,rowSpan:20});
A.set({height:200});
A.setStatusBarVisible(false);
The result is three columns of equal default width. I'd like the widths
of the three columns to be set to different values, so the user doesn't
have to manually drag them to the right size.
I can't see anything in the doco. How do I do that?
Thanks.
------------------------------------------------------------------------------
What NetFlow Analyzer can do for you? Monitors network bandwidth and
traffic
patterns at an interface-level. Reveals which users, apps, and protocols
are
consuming the most bandwidth. Provides multi-vendor support for NetFlow,
J-Flow, sFlow and other flows. Make informed decisions using capacity
planning
reports.http://sdm.link/zohodev2dev
_______________________________________________
qooxdoo-devel mailing list
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
Peter Caffin
2016-07-12 18:07:34 UTC
Permalink
Hi Derrell,


Thanks for that. It worked! For anyone reading this thread in the future
through Google...


T0001Model = new qx.ui.table.model.Simple();
T0001Model.setColumns(["Title","Created","Last modified"]);
T0001Model.setData([
["Systems Administrator", "2015-01-01 10:10:02", "2015-09-01 10:10:02"],
["Network Administrator", "2015-02-01 10:10:02", "2015-09-01 10:10:02"],
["Devops", "2015-03-01 10:10:02", "2015-09-01 10:10:02"]
]); // EXAMPLE DATA
T0001 = new qx.ui.table.Table(T0001Model,
{tableColumnModel:function(T0001) {return new
qx.ui.table.columnmodel.Resize(T0001);}});
b0001.add(T0001,{row:1,column:0,rowSpan:20});

var tcm = T0001.getTableColumnModel();
tcm.getBehavior().setWidth(0,250);
tcm.getBehavior().setWidth(1,140);
tcm.getBehavior().setWidth(2,140);
Post by Derrell Lipman
Hi Peter. The secret is to use the Resize table column model instead
of the default, Basic table column model. See the example in the
http://qooxdoo.678.n2.nabble.com/Controlling-Column-Sizes-in-the-Table-widget-td5823201.html
Cheers,
Derrell
Loading...