Skip to content

Instantly share code, notes, and snippets.

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