tags:

views:

23

answers:

0

Hey all,

I am using a datagrid with some custom itemrenderers. I am trying to save the last cell (row and column index) the mouse was over when the context menu was opened. I am trying do this with the itemrollover but it doesn't seem to fire when I roll over my custom itemrenderers when I enter them from within the datagrid region. If I move the mouse outside the datagrid and enter the cell from the bottom it works. Any ideas? Thanks.

Update:

Here is the important part of the code. if you try this you will notice that onItemRollOver fire over the the cells in the first four columns regardless of what direction you enter a cell from; however, the last three(those using itemRenderers) only fire if enter from the top or bottom, and I imagine this is simplely because a change in the selectedIndex.

<mx:Script>
<![CDATA[
    private var currentRow:int;
    private var currentCol:int;

    private function onItemRollOver(event:ListEvent):void
    {
         trace('listEvent');
         currentRow = event.rowIndex;
         currentCol = event.columnIndex;
    } 
]]>
</mx:Script>

<mx:DataGrid id="grid" dataProvider="{gridData}" editable="true" itemRollOver="onItemRollOver"> 
<mx:columns>
    <mx:DataGridColumn headerText="Name" dataField="name" itemEditor="mx.controls.TextInput" 
        editorDataField="text" showDataTips="true"
    />
    <mx:DataGridColumn headerText="Short Name" dataField="shortName" 
        itemEditor="mx.controls.TextInput" showDataTips="true"
    />
    <mx:DataGridColumn headerText="Account #" dataField="custodyAcctNum" 
        itemEditor="mx.controls.TextInput"   
    />
    <mx:DataGridColumn headerText="Benchmark ID" dataField="benchmarkId" 
        itemEditor="mx.controls.TextInput" 
    />
    <mx:DataGridColumn headerText="Demo" dataField="demo"  editorDataField="selected" 
        itemRenderer="mx.controls.CheckBox" rendererIsEditor="true" textAlign="center"
    />
    <mx:DataGridColumn headerText="Managed" dataField="advisors" textAlign="center" 
        itemRenderer="mx.controls.CheckBox" rendererIsEditor="true" editorDataField="selected" 
    /> 
    <mx:DataGridColumn headerText="Custody Download" dataField="custodyDownload"  
        textAlign="center" itemRenderer="mx.controls.CheckBox" rendererIsEditor="true" 
        editorDataField="selected" 
    />
</mx:columns>
</mx:DataGrid>