Re: [qooxdoo-devel] Selectable?
Brought to you by:
ecker,
martinwittemann
From: Derrell L. <der...@un...> - 2010-02-28 15:43:40
|
On Sun, Feb 28, 2010 at 09:53, smi...@go... < smi...@go...> wrote: > I need a list and i dont want that i can select the elemens via > mouse clicks. i try this > > getChatlist : function(){ > this.chatList = new qx.ui.form.List; > this.chatList.setScrollbarX("off"); > this.chatList.set({selectionMode : "single"}); > this.chatList.setSelectable(false); > this.getChatlistStartData(); > return this.chatList; > }, > > > but i can always select entrys. How can i turn off this ? > That appears to not be possible with simple property settings. Maybe there should be a selectionMode:"none" but there isn't. The code I reviewed to find a possible answer were qx.ui.form.List, which includes qx.ui.core.MMultiSelectionHandling which creates a selection manager based on this.SELECTION_MANAGER. Since MMultiSelectionHandling is a mixin, 'this' refers to the object of the class that included the mixin, which was List. List does, in fact, define SELECTION_MANAGER to be qx.ui.core.selection.ScrollArea. The ScrollArea manager has an _isSelectable method that could be overridden. So one way to accomplish what you're after seems to be to extend qx.ui.core.selection.ScrollArea to, for example, custom.MySelectionScrollArea and override the _isSelectable method. It doesn't appear that instantiating a list does anything with a selection manager, so you can probably simply instantiate your list: var list = new qx.ui.form.List(); and then set the selection manager to be your selection subclass: list.SELECTION_MANAGER = custom.MySelectionScrollArea; I never tried this, but hopefully it'll work for you, or put you on a path towards something that works. You might post an enhancement bug to bugzilla requesting a selectionMode:"none". Then again, there may be an easier way to do what you're looking for that I didn't come across in my research. If so, someone will point it out. Derrell |