简体   繁体   中英

flex 4 list no selectable false?

is there any way to either set a flex 4 list component to selectable "false" or disable/hide its selectioncolor? I've tried to change it designview, but it doesn't allow me change it that way. I've also tried tweaking it via the list component or the scroller/viewport control via as3, but I really can't seem to fin a way.

If you have a list that doesn't have selection, you can quickly change it into DataGroup . Sometimes I even prefer using DataGroup instead of the List and if I need to manage a selection I add the selection state to the items in the data provider , thus each item would know whether it is selected. This solution allows me to perform filtering, sorting, reordering on the list and still keep the selected state of the items.

try to put this on

ItemRenderer property
autoDrawBackground="false"

If you are making a mobile app and using IconItemRender (instead of ItemRenderer) there is no autoDrawBackground property. I did manage to find a solution and posted it here: Flex/FlashBuilder :: Spark List / IconItemRenderer:: Disable Selection Highlight / No Selection / Remove Selection

You could use an item renderer for the List, and set the selection color in the item renderer. Here are some examples of this:

Styling both foreground and background selection color in a Flex list/datagrid

您可能会发现这篇文章及其中的链接对于构建支持无法选择的项目的列表很有用: http : //flexponential.com/2009/12/20/disable-selection-on-some-items-in-a-spark-列表/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM