The following example shows how you can enable or disable live scrolling on a Flex ComboBox control’s dropdown menu by setting the liveScrolling property on the ComboBox control’s dropdown property.
Full code after the jump.
<?xml version="1.0" encoding="utf-8"?>
<!-- http://blog.flexexamples.com/2008/07/05/toggling-live-scrolling-on-a-combobox-controls-dropdown-menu-in-flex/ -->
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
layout="vertical"
verticalAlign="top"
backgroundColor="white">
<mx:Script>
<![CDATA[
import mx.events.DropdownEvent;
private function comboBox_open(evt:DropdownEvent):void {
comboBox.dropdown.liveScrolling = checkBox.selected;
comboBox.dropdown.showScrollTips = true;
}
]]>
</mx:Script>
<mx:Array id="arr">
<mx:Object label="One" />
<mx:Object label="Two" />
<mx:Object label="Three" />
<mx:Object label="Four" />
<mx:Object label="Five" />
<mx:Object label="Six" />
<mx:Object label="Seven" />
<mx:Object label="Eight" />
<mx:Object label="Nine" />
<mx:Object label="Ten" />
</mx:Array>
<mx:ApplicationControlBar dock="true">
<mx:Form styleName="plain">
<mx:FormItem label="liveDragging:">
<mx:CheckBox id="checkBox"
selected="true" />
</mx:FormItem>
</mx:Form>
</mx:ApplicationControlBar>
<mx:ComboBox id="comboBox"
dataProvider="{arr}"
open="comboBox_open(event);" />
</mx:Application>
View source is enabled in the following example.





0 Responses to “Toggling live scrolling on a ComboBox control's dropdown menu in Flex”
Leave a Reply