Hello Georg,
I am a beginner too. But I think your problem is that you have copied the
table code from QX demobrowser. And there the basic table or TableDemo is
inherited
extend : demobrowser.demo.table.TableDemo,
This contains the function createRandomRows
In your code this function does not exist.
If you add the function it works
-----------------------------------------------
// Create the initial data
var rowData = 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();
doc.add(table, {left: 200, top: 100});
function createRandomRows(rowCount) {
var rowData = [];
var now = new Date().getTime();
var dateRange = 400 * 24 * 60 * 60 * 1000; // 400 days
var nextId = 0;
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;
}
-----------------------------------------------
georg-25 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-tp5545601p5545601.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
>
>
--
View this message in context:
http://old.nabble.com/simple-table-in-HelloWorld-tp29745850p29746519.html
Sent from the qooxdoo-devel 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