On Thu, Apr 30, 2009 at 7:18 PM, Michael Helwig <[email protected]>wrote:
> Hi,
> I'm still struggling with the table. I changed the selection mode to 2
> (since I noticed that 1 means "no selection"), however, this does NOT
> influence the table's behavior. I figured out that I can add a
> selection of some cell via code and then, once a cell is selected, I
> can navigate through the table with the help of the arrow-keys. I even
> can set columns editable and edit cells when double-clicking on them,
> once they are selected. However, a single click does NOT select a row
> or a cell (I tried to write an event listener for the table reacting
> on a cell-click event, but somehow the event is not send when I click
> on a cell). Nor do I have sucess with scrolling. The data is loaded
> correctly, but it is cut of by the table and I do not know how to show it.
>
> I'm wondering what's going on with this widget. I read through the
> tutorials and examples once again but there seems to be no relevant
> difference. Any help would be greatly appreciated.
>
Hi Michael,
Try this code in the playground app. When you run this, you can click on a
row in the table and you'll see an alert come up showing the ranges of
selected rows. Use ctrl-click to add a selection, or shift-click to select
the range between the previous selection and the current click, or
control-shift-click to keep any out-of-order existing selections and add a
new range of selected rows beginning at the previous selection and extending
to the current click.
var tableModel = new qx.ui.table.model.Simple();
tableModel.setColumns(["one", "two", "three"]);
var table = new qx.ui.table.Table(tableModel);
this.getRoot().add(table);
var tableData = [ ["row 1", "a", "A"],
["row 2", "b", "B"],
["row 3", "c", "C"],
["row 4", "d", "D"]
];
tableModel.setData( tableData );
var selectionModel = table.getSelectionModel();
selectionModel.setSelectionMode(qx.ui.table.selection.Model.
MULTIPLE_INTERVAL_SELECTION);
selectionModel.addListener("changeSelection",
function()
{
var msg = qx.dev.Debug.debugObjectToString(
selectionModel.getSelectedRanges(),
"selected
ranges");
alert(msg);
});
Hope this helps.
Derrell
------------------------------------------------------------------------------
Register Now & Save for Velocity, the Web Performance & Operations
Conference from O'Reilly Media. Velocity features a full day of
expert-led, hands-on workshops and two days of sessions from industry
leaders in dedicated Performance & Operations tracks. Use code vel09scf
and Save an extra 15% before 5/3. http://p.sf.net/sfu/velocityconf
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel