Hello Georg,
and welcome to qoxxdoo
The crucial point in your code is this statement:
var rowData = this.createRandomRows(50);
When running your application I'm sure you'll find the following message in
your browser's error console:
"this.createRandomRows is not a function"
If you add the following code snippet to the "members" section of your
application, the table should finally be displayed:
createRandomRows : function(rowCount)
{
var rowData = [];
var nextId = 0;
var now = new Date().getTime();
var dateRange = 400 * 24 * 60 * 60 * 1000; // 400 days
for (var row = 0; row < rowCount; row++) {
var date = new Date(now + Math.random() * dateRange - dateRange / 2);
rowData.push([ nextId++, Math.random() * 10000, date, (Math.random() >
0.5) ]);
}
return rowData;
}
Best regards,
Norbert
georg wrote:
>
> Hello,
>
> i'am a beginner in programming qooxdoo.
> Who can help me to understand the structur to add a table.
> I try it to add a table after the HelloWorld example, but the table
> doesn't appears in the window.
>
> Best Regards,
> Georg
>
> // Add an event listener
> button1.addListener("execute", function(e) {
> alert("Hello World!");
> });
>
>
> // Create the initial data
> var rowData = this.createRandomRows(50);
>
> // table model
> var tableModel = this._tableModel = new qx.ui.table.model.Simple();
> tableModel.setColumns([ "ID", "A number", "A date", "Boolean" ]);
> tableModel.setData(rowData);
> tableModel.setColumnEditable(1, true);
> tableModel.setColumnEditable(2, true);
> tableModel.setColumnSortable(3, false);
>
> // table
> var table = new qx.ui.table.Table(tableModel);
>
> table.set({
> width: 600,
> height: 400,
> decorator : null
> });
>
> table.getSelectionModel().setSelectionMode(qx.ui.table.selection.Model.MULTIPLE_INTERVAL_SELECTION);
>
> var tcm = table.getTableColumnModel();
> var tableRoot = this.getRoot();
> tableRoot.add(table, {left: 200, top: 100});
>
--
View this message in context:
http://qooxdoo.678.n2.nabble.com/simple-table-in-HelloWorld-tp5545601p5545886.html
Sent from the qooxdoo mailing list archive at Nabble.com.
------------------------------------------------------------------------------
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel