I'm not clear what you want.  You want arrow keys and pageup/dn to
navigate to various cells and then edit those cells?

 

________________________________

From: [email protected] [mailto:[EMAIL PROTECTED] On
Behalf Of Dominic Pazula
Sent: Monday, February 11, 2008 5:10 AM
To: [email protected]
Subject: [flexcoders] Re: Keyboard navigation to objects within
components

 

Yeah, I still can't get it to work. I've simplified the test down to 
a basic DG. Adding editable=true on the DG disables the up and down 
arrow.

Here's the test project. The data file can be found at 
http://www.talonrisk.com/apps/test/data.xml
<http://www.talonrisk.com/apps/test/data.xml> 

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml
<http://www.adobe.com/2006/mxml> " 
layout="absolute">
<mx:Script>
<![CDATA[
import mx.rpc.events.ResultEvent;
import mx.events.DataGridEvent;
import mx.events.ListEvent;
private var sRow:int;
private var sCol:int;

private function selectCell(event:ListEvent):void{
sCol = event.columnIndex;
sRow = event.rowIndex;

sRowText.text = "Selected Row: " + 
sRow.toString();
sColText.text = "Selected Column: " 
+sCol.toString(); 
}

private function focusHandler
(event:DataGridEvent):void{
sRow = event.rowIndex;
sCol = event.columnIndex;

sRowText.text = "Selected Row: " + 
sRow.toString();
sColText.text = "Selected Column: " + 
sCol.toString();
}

private function resHandler(event:ResultEvent):void{
dg.dataProvider = event.result.TABLE.X;
}
]]>
</mx:Script>

<mx:HTTPService url="data.xml" result="resHandler(event)" id="data"/>
<mx:VBox height="100%" width="100%" creationComplete="data.send()">
<mx:HBox width="100%">
<mx:Text id="sColText"/>
<mx:Text id="sRowText"/>
</mx:HBox>
<mx:DataGrid id="dg" height="100%" width="100%"
itemClick="selectCell(event)"
itemFocusIn="focusHandler(event)"
editable="true">
<mx:columns>
<mx:DataGridColumn dataField="date" 
editable="true" rendererIsEditor="true"/>
<mx:DataGridColumn dataField="char" 
editable="true" rendererIsEditor="true"/>
<mx:DataGridColumn dataField="num" 
editable="true" rendererIsEditor="true"/>
</mx:columns>

</mx:DataGrid>
</mx:VBox> 
</mx:Application>

--- In [email protected] <mailto:flexcoders%40yahoogroups.com>
, "Alex Harui" <[EMAIL PROTECTED]> wrote:
>
> The dataGrid also has editable=true? Try a test with a simple DG 
to see
> how it behaves before going back to ADG.
> 
> 
> 
> ________________________________
> 
> From: [email protected] <mailto:flexcoders%40yahoogroups.com>

[mailto:[email protected] <mailto:flexcoders%40yahoogroups.com>
] On
> Behalf Of Dominic Pazula
> Sent: Sunday, February 10, 2008 3:46 PM
> To: [email protected] <mailto:flexcoders%40yahoogroups.com> 
> Subject: [flexcoders] Re: Keyboard navigation to objects within
> components
> 
> 
> 
> I finally got around to trying this. 
> 
> It doesn't work. 
> 
> Setting the column to editable=true and rendererIsEditor=true still 
> does not fire the itemFocusIn event.
> 
> The change event ALMOST allows me to track which cell is 
highlighted 
> with keyboard navigation. However, if the user scrolls onto the 
> header, the change event is not fired when the user scolls off the 
> header.
> 
> So, original question: 
> I have an AdvancedDataGrid and I want track the user paging up, 
down,
> and across the grid with the arrow keys. I don't want the data to be
> editable, which means I cannot use the itemFocusIn event (thrown, as
> you say, by the item editor).
> 
> Is there an easy way to do this without rewriting the item renderer?
> 
> Thanks
> Dom
>

 

Reply via email to