Didn't run the code, but I would expect your mouseOver handler to check
to see if it is contained by the datagrid's scrollbar.  Check out the
contain() method.

________________________________

From: [email protected] [mailto:[EMAIL PROTECTED] On
Behalf Of sanjaypmg
Sent: Wednesday, April 11, 2007 1:50 AM
To: [email protected]
Subject: [flexcoders] ToolTip on rollOver on Grid's SCROL bar



Hi All,

We have a scrollTipFunction event for dataGrid which show the 
toolTip when user drags the scrollbar...

But here I want this toolTip on rolling move over the scroll bar of 
the dataGrid. I have done something to get it done but i guess its 
not a proper solution.... and facing a lots of problm... 

Will you pls help me to get it done.... 

Thanks in Advance,
SS

========================== CODE =================================

<?xml version="1.0"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml
<http://www.adobe.com/2006/mxml> " 
initialize="initData();">

<mx:Script>
<![CDATA[

import mx.managers.ToolTipManager;
import mx.controls.ToolTip;
import mx.events.ToolTipEvent;
import mx.collections.ArrayCollection;
import mx.controls.Alert;
import flash.events.MouseEvent;

public var myTip:ToolTip;

[Bindable]
public var authorsDataProvider : ArrayCollection = new 
ArrayCollection( [
{sNo: "1", Selected: "", Country: "USA", Gold: 35, 
Status:"Active", URL:"http://www.google.com <http://www.google.com> " },
{sNo: "2", Selected: "", Country: "China", Gold: 32, 
Status:"Deactive",URL:"http://www.yahoo.com <http://www.yahoo.com> "},
{sNo: "3", Selected: "", Country: "Russia", Gold: 
27,Status:"Deactive", URL:"http://www.hotmail.com
<http://www.hotmail.com> " },
{sNo: "4", Selected: "", Country: "India", Gold: 12, 
Status:"Active",URL:"http://www.gmail.com <http://www.gmail.com> "},
{sNo: "5",Selected: "", Country: "Russia", Gold: 27, 
Status:"Deleted",URL:"http://www.hotmail.com <http://www.hotmail.com> "
},
{sNo: "6",Selected: "", Country: "Russia", Gold: 27, 
Status:"Deleted",URL:"http://www.hotmail.com <http://www.hotmail.com> "
},
{sNo: "7", Selected: "", Country: "China", Gold: 32, 
Status:"Deactive",URL:"http://www.yahoo.com <http://www.yahoo.com> "},
{sNo: "8", Selected: "", Country: "Russia", Gold: 
27,Status:"Deactive", URL:"http://www.hotmail.com
<http://www.hotmail.com> " },
{sNo: "9", Selected: "", Country: "India", Gold: 12, 
Status:"Active",URL:"http://www.gmail.com <http://www.gmail.com> "},
{sNo: "10",Selected: "", Country: "Russia", Gold: 27, 
Status:"Deleted",URL:"http://www.hotmail.com <http://www.hotmail.com> "
},
{sNo: "11",Selected: "", Country: "Russia", Gold: 27, 
Status:"Deleted",URL:"http://www.hotmail.com <http://www.hotmail.com> "
},
{sNo: "12", Selected: "", Country: "China", Gold: 32, 
Status:"Deactive",URL:"http://www.yahoo.com <http://www.yahoo.com> "},
{sNo: "13", Selected: "", Country: "Russia", Gold: 
27,Status:"Deactive", URL:"http://www.hotmail.com
<http://www.hotmail.com> " },
{sNo: "14", Selected: "", Country: "India", Gold: 12, 
Status:"Active",URL:"http://www.gmail.com <http://www.gmail.com> "},
{sNo: "15",Selected: "", Country: "Russia", Gold: 27, 
Status:"Deleted",URL:"http://www.hotmail.com <http://www.hotmail.com> "
},
{sNo: "16",Selected: "", Country: "Russia", Gold: 27, 
Status:"Deleted",URL:"http://www.hotmail.com <http://www.hotmail.com> "
} ]);


// Data initialization.
public function initData():void {

myDataGrid.addEventListener(MouseEvent.MOUSE_OVER, 
mouseOverHandler);

}

public function mouseOverHandler(eventObj:Event):void {
//createTip();
var s:String = "X = "+ myDataGrid.mouseX.toString() 
+"\n Y = "+ myDataGrid.mouseY.toString();

mPos.text = s;
if(myDataGrid.mouseY < 150 ){


}else{

ToolTipManager.currentToolTip.text = s;
}

}
]]>
</mx:Script>

<mx:Panel title="CheckBox Control Example" height="75%" 
width="75%" 
>

<mx:DataGrid allowMultipleSelection="true" id="myDataGrid" 
dataProvider="{authorsDataProvider}" 
verticalScrollPolicy="on" 
horizontalScrollPolicy="on" toolTip=" " scrollTipFunction=""
>

</mx:DataGrid>
<mx:TextArea id="mPos"/>

</mx:Panel>
</mx:Application>



 

Reply via email to