I had developed one where the renderer contained a checkbox.
It did bot show highlights on all the sekected
This is the code.
See if it might help
package com
{
import flash.events.Event;
import flash.events.KeyboardEvent;
import flash.events.MouseEvent;
import mx.controls.ComboBox;
import mx.events.ListEvent;
public class WorkflowComboBox extends ComboBox
{
private var ctrlKey:Boolean = false;
public function WorkflowComboBox()
{
super();
//dropdown.addEventListener(MouseEvent.ROLL_OUT,
mouseOutHandler);
}
public function mouseOutHandler(e:MouseEvent):void
{
super.close()
}
override public function close(trigger:Event=null) : void
{
//if(dropdown.mo)
/* if ( !ctrlKey )*/
if(dropdown.visible == false)
super.close( trigger );
}
override protected function keyDownHandler(event:KeyboardEvent)
:
void
{
super.keyDownHandler( event );
ctrlKey = event.ctrlKey;
if ( ctrlKey )
dropdown.allowMultipleSelection = true;
}
override protected function keyUpHandler(event:KeyboardEvent) :
void
{
super.keyUpHandler( event );
ctrlKey = event.ctrlKey;
if ( !ctrlKey )
{
close();
var changeEvent:ListEvent = new ListEvent(
ListEvent.CHANGE )
dispatchEvent( changeEvent );
}
}
public function set selectedItems( value:Array ) : void
{
if ( dropdown )
dropdown.selectedItems = value;
}
[Bindable("change")]
public function get selectedItems( ) : Array
{
if ( dropdown )
return dropdown.selectedItems;
else
return null;
}
public function set selectedIndices( value:Array ) : void
{
if ( dropdown )
dropdown.selectedIndices = value;
}
[Bindable("change")]
public function get selectedIndices( ) : Array
{
if ( dropdown )
return dropdown.selectedIndices;
else
return null;
}
}
}
Thanks and Regards
Nitin
On Mar 12, 6:47 pm, Anoop Max
<[email protected]> wrote:
> Hi All,
>
> We are using Flex 2 for our application and now am facing a
> requirement where I need to implement multiselect dropdown, which I
> guess is not there in Flex2 combo box. I tried to extend current combo
> box control, but its creating lots of trouble, when I call change
> event. It would be a great help for me if somebody had already
> developed such a combo box or have such code somewhere in the net.
> Please help.
>
> Thanks in advance,
>
> Happy Coding,
> Anoop
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Flex
India Community" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/flex_india?hl=en
-~----------~----~----~----~------~----~------~--~---