On 04/19/2012 09:59 PM, Simon Walter wrote:
> How is it possible to confine a selection to a single row?
..
>I had an idea to use the
> isItemSelectable method and store the first cell that was clicked on,
> and then use that as a reference to restrict further horizontal
> selection, but I don't know if that is the best way to do it.
>
I've gone ahead with this idea. It seems to be working well. I'm using
the mousedown and mouseup event on a qx.ui.virtual.core.Scroller:
scroller.addListener("mousedown", function(e){
this.selectedRow = this.manager.getLeadItem().row;
}, this);
scroller.addListener("mouseup", function(e){
this.selectedRow = null;
}, this);
and the isItemSelectable method:
isItemSelectable : function(item)
{
if (item.row == this.selectedRow || this.selectedRow == null)
return !!this.items[item.row][item.column];
else
return false;
}
Full code here:
http://pastebin.com/E43U0ykd
If anyone knows a more efficient way of doing this, I'd like to hear
about it. Conversely, if this is probably the best way to accomplish
this, I'd like to hear that as well - just to reassure myself I'm not
throwing away CPU cycles on the client.
Cheers,
Simon
--
simonsmicrophone.com
------------------------------------------------------------------------------
For Developers, A Lot Can Happen In A Second.
Boundary is the first to Know...and Tell You.
Monitor Your Applications in Ultra-Fine Resolution. Try it FREE!
http://p.sf.net/sfu/Boundary-d2dvs2
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel