Learning Qooxdoo - 2

How to create a simple table?

There are two importent things exist in qooxdoo table class (qx.ui.table.Table) - Model and Selection.

 The model represents the columns and data of the table, and the selection is used to control single or multi-selection.

var model = new qx.ui.table.model.Simple();
model.setColumns(["ID", "User Name", "Sex", "Age"]);
model.setData([
['1', 'Zhangsan', 'man', 17],
['2', 'Lisi', 'man', 23],
['3', 'Wanger', 'man', 25],
['4', 'Mazi', 'man', 20],
['5', 'Chunhua', 'woman', 18]
]);

var table = new qx.ui.table.Table(model);
table.set({
width: 600,
height: 400
});

table.getSelectionModel().setSelectionMode(qx.ui.table.selection.Model.MULTIPLE_INTERVAL_SELECTION);

this.getRoot().add(table, { left: 20, top: 50 });

posted @ 2009-06-01 16:41  三生石上(FineUI控件)  阅读(369)  评论(0编辑  收藏  举报