In a previous example, “Disabling keyboard navigation on the Accordion container in Flex”, we saw how to disabe keyboard navigation on the Flex Accordion container by overriding the keyDownHandler() method.
The following example shows how you can disable keyboard navigation on the Flex List control by extending the List class and overriding the protected keyDownHandler() method.
Full code after the jump.
<?xml version="1.0" encoding="utf-8"?>
<!-- http://blog.flexexamples.com/2008/06/11/disabling-keyboard-navigation-on-the-list-control-in-flex/ -->
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
xmlns:comps="comps.*"
layout="vertical"
verticalAlign="middle"
backgroundColor="white">
<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:Array>
<comps:MyList id="list"
dataProvider="{arr}"
width="100" />
</mx:Application>
/**
* http://blog.flexexamples.com/2008/06/11/disabling-keyboard-navigation-on-the-list-control-in-flex/
*/
package comps {
import flash.events.KeyboardEvent;
import mx.controls.List;
public class MyList extends List {
public function MyList() {
super();
}
override protected function keyDownHandler(event:KeyboardEvent):void {
}
}
}
View source is enabled in the following example.





thanks for you tutorials~ very userful!@
Thank you for your tutorials.
It’s possible to set a handCursor to a DataGrid Control?
I mean not only the Headers but the list too, preserving the list properties like the roll over and the selected Item color while using the hand cursor on the rows.
Thank you for your time.