View Full Version : Disabled List control behaviour
Hi,
Default disabled List control has also its ScrollBar disabled. How can I enable ScrollBar in disabled List without enabling whole control?
Tnx.
you could disable all the items in the List instead of the List itself using a loop and indexToItemRenderer.
I've tried this but still have several problems. By default indexToItemRenderer returns IListItemRenderer only for visible items. Rest of them are not created - must be default List items creationPolicy. Which event is dispatched after item creation, or how to force List to create all items?
Another problem is that I can still select and deselect disabled items.
Can u show your code. you shouldn't be able to interact with a disabled instance.
Also you only need to disable visible items right? If is aint visible then why do you need to disable it?
My list disable code snippet:
function setListElementsEnabled(list:List, enabled:Boolean):void {
for (var i:int = 0; i < list.rowCount; i++) {
// indexToItemRenderer returns null for not created instances
if (list.indexToItemRenderer(i)) {
list.indexToItemRenderer(i).enabled = enabled;
}
}
}
I want to disable whole List control but still have ability to use list scroll. List can contain more elements than visible max. Some elements are also selected. My desired component behavior is "readonly like".
dr_zeus
01-25-2007, 06:00 PM
By default indexToItemRenderer returns IListItemRenderer only for visible items.
The List component, and others like it, will only create the number of renderers required to show the visible items. When the visible items change, it reuses the renderers and alters their data providers. It's very important for optimization purposes. If you have a list of two million items, it would be bad for performance and memory usage if it had to create a renderer for every single item.
Have similar problem here. It's good they optimize, but how do I affect the renderers of the items that I scroll to - ones that doesn't exist and are created by flex when list scrolls?
vBulletin® v3.7.1, Copyright ©2000-2009, Jelsoft Enterprises Ltd.