1. Key directions were not being assigned.
2. When a disabled item was at either the top or the bottom of the list it would stop you being able to continue down / up the list.
To fix this i added the following code.
/** * @inheritDoc. * set our offscreen items to at least 4 so * that if the last / first visible item * is disabled we can still move the view * up or down without getting stuck? */ override public function initialize():void { super.initialize( ); offscreenExtraRowsOrColumns = Math.max( 4, offscreenExtraRowsOrColumns ); } /** * @inheritDoc. * capture key directions. */ override protected function keyDownHandler(event:KeyboardEvent):void { if( event.keyCode == Keyboard.UP ) { _selectionIsAbove = true; }else if( event.keyCode == Keyboard.DOWN ) { _selectionIsAbove = false; } super.keyDownHandler( event ); }
And then I changed the finishKeySelection( ) method as follows.
/** * @inheritDoc. * check to see if our selected item is * allowed to be selected or not. */ override protected function finishKeySelection():void { super.finishKeySelection( ); var i : int; var rowCount : int = listItems.length; var count : Number = 0; var item : IListItemRenderer = listItems[ caretIndex - verticalScrollPosition + offscreenExtraRowsTop ][ 0 ]; if( item ) { if( item.data ) { if( disabledFilterFunction( item.data ) ) { //trace( 'ITEM IS DISABLED : ' + disabledFilterFunction( item.data ) ); //trace( 'SELECTION IS ABOVE : ' + _selectionIsAbove ); var currIndex : int = caretIndex - verticalScrollPosition; if( _selectionIsAbove ) { //LookUp i = currIndex + offscreenExtraRowsTop; count = 0; while( i > 0 ) { item = listItems[ i ][ 0 ]; if( !disabledFilterFunction( item.data ) ) { selectedIndex = selectedIndex + count; return; } count --; i--; } selectedIndex = selectedIndex +1; //trace( 'CANT GO UP ANYMORE' ); return; }else{ //Look down. i = currIndex + offscreenExtraRowsTop; count = 0; while( i < rowCount ) { item = listItems[ i ][ 0 ]; if( !disabledFilterFunction( item.data ) ) { selectedIndex = selectedIndex + count; return; } count ++; i++; } selectedIndex = selectedIndex -1; //trace( 'CANT GO DOWN ANYMORE' ); return; } } } } }
I dont know if this will help anyone but im sure glad i got it working.