I figured it out.
It was an epic “programming” journey over the weekend for me to figure out how to do the rollover on the items within the datagrid.
First, I found out that this lib(flexlib:VAccordion) cannot be used with Flex Builder 2, which is what I have at home. Then I found out that Flex Builder 3 can only run with Java 1.5, which is the version of Java that is allowed to install on 10.5 OS, which I am running 10.4. After that, I found out that the flexlib:VAccordion from the open source google code could not be implemented at the component level, which had me starting over from scratch. So, after battling with myself on how long it would take for me to get fired, I had to figure out that I had to use a listEvent, rather than a MouseEvent.
This morning, I discovered in an adobe tech manual, that itemRollOver, as opposed to RollOver, uses the ListEvent and not the MouseEvent. From there I was able to determine the rowIndex and the rest is datagrid history.
-
first, use the itemRollOver within the datagrid header
-
<mx:DataGrid xmlns:mx="http://www.adobe.com/2006/mxml"
-
width="100%" height="100%"
-
verticalScrollPolicy="on"
-
paddingBottom="0" paddingLeft="0" paddingRight="0" paddingTop="0"
-
itemClick="onItemClick(event)"
-
variableRowHeight="true"
-
borderThickness="0"
-
showHeaders="false"
-
verticalGridLines="false"
-
selectionColor="#EEEEEE"
-
rollOverColor="#D3D8DE"
-
textRollOverColor="#FFFFFF"
-
textSelectedColor="#000000"
-
color="#FFFFFF"
-
styleName="listView"
-
itemRollOver="onMouseOver(event)"
-
>
-
-
Then use this function to expand each row that the mouse rolls over:
-
-
import mx.events.DataGridEvent;
-
-
private function onMouseOver(event:ListEvent):void
-
{
-
var myRow = event.rowIndex;
-
var data2 : ArrayCollection = this.dataProvider as ArrayCollection;
-
-
for(var i:int = 0; i < data2.length; i++)
-
{
-
var dat2 : AssetInfo = data2[i] as AssetInfo;
-
-
if (dat2 != data2[myRow] && dat2.expanded != false)
-
dat2.expanded = false;
-
}
-
data2[myRow].expanded = true;
-
//trace(myRow);
-
}
-
And that's all there is to it :-)