I am also having an issue with graphics in the floating datagrid, in the Querybuilder widget. I used Roberts enhanced search widget as my basis. I created the floating datagrid, and the csv save function works as well. But I am stuck on getting a rollover function that I have working with the datagrid if it is the viewstack of the query to work in the floating grid (renamed QueryWidgetFloatingDG.mxml).The grid is activated with the following script:private function showGridResults(event:MouseEvent):void{
if(!myfloatdg){
var myfloatdg:QueryBuilderWidgetFloatDG;
myfloatdg = QueryBuilderWidgetFloatDG(PopUpManager.createPopUp(map,QueryBuilderWidgetFloatDG,false));
PopUpManager.centerPopUp(myfloatdg);
myfloatdg.dProvider = QBData.dataProvider;
}else{
PopUpManager.addPopUp(myfloatdg,map,false);
PopUpManager.centerPopUp(myfloatdg);
}
}
This following code works to produce a rollover effect in the widgets own datagrid: private function onItemRollOver(event:ListEvent):void
{
var gr:Graphic = findGraphicByAttribute(event.itemRenderer.data)
gr.symbol = highlightSymbol;
QBData.selectedIndex = findInList(gr);
// gr.symbol = sfs;
I derived the following from Roberts widget but it does not seem to help with the rollover function in the floating datagrid:
if (myfloatdg){
if(myfloatdg.datagrid.dataProvider)
myfloatdg.datagrid.dataProvider.removeAll();
myfloatdg.csvName = _csvName;
myfloatdg.dgColumns = gridFields;
myfloatdg.dProvider = fset.attributes;
myfloatdg.graphicslayer = mqGraphicsLayer;
// myfloatdg.zoomScale = zoomScale;
myfloatdg.ownerWidget = QBWidget;
}
}
And I added a mouseover function in imitation of Ken's script: private function onMouseOver(event:MouseEvent):void
{
var graphic:Graphic = Graphic(event.target);
for each (var attributes:Object in myfloatdg.datagrid.dataProvider)
{
if (attributes["ID"] == graphic.attributes["ID"])
{
myfloatdg.datagrid.selectedIndex = (myfloatdg.datagrid.dataProvider as ArrayCollection).getItemIndex(attributes)
}
}
myfloatdg.resultsGrid.scrollToIndex(QBData.selectedIndex)
}
Sorry for the hack work. Any help will be greatly appreciated. Thanks,Jim Faron