继续浏览精彩内容
慕课网APP
程序员的梦工厂
打开
继续
感谢您的支持,我会继续努力的
赞赏金额会直接到老师账户
将二维码发送给自己后长按识别
微信支付
支付宝支付

Learning Qooxdoo - 2

慕田峪0738999
关注TA
已关注
手记 344
粉丝 88
获赞 493

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 });

打开App,阅读手记
0人推荐
发表评论
随时随地看视频慕课网APP