Skip to content

Instantly share code, notes, and snippets.

@zaucker
Created February 11, 2010 14:18
Show Gist options
  • Save zaucker/301539 to your computer and use it in GitHub Desktop.
Save zaucker/301539 to your computer and use it in GitHub Desktop.
[qx] table 1
var tableModel = new qx.ui.table.model.Simple();
tableModel.setColumns([ "Location", "Team" ]);
var table = new qx.ui.table.Table(tableModel);
var button = new qx.ui.form.Button("Delete");
var doc = this.getRoot();
doc.add(button, {left: 100, top: 20});
doc.add(table, {left: 20, top: 70});
table.getTableColumnModel().setDataCellRenderer(0,new qx.ui.table.cellrenderer.Number);
var data = [ [1, 'team1'],
[2, 'team2'],
[3, 'team3']
];
tableModel.setData(data);
tableModel.setColumnEditable(0,true);
/* Delete 2nd row */
button.addListener("execute", function(e) {
tableModel.removeRows(1,1);
});
table.addListener("cellClick", function (e) {
this.debug('cellClick event');
}, this);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment