Flex DataGrid Tooltip dataTipFunction Example
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" initialize="doInit();">
<mx:Script>
<!![CDATA[import mx.collections.ArrayCollection; // this holds the grid data
[Bindable]
private var myData:ArrayCollection = new ArrayCollection();private function doInit():void{
myData.addItem({fname:"Joe",lname:"Bloggs"});
myData.addItem({fname:"Joe1",lname:"Bloggs"});
}
private function buildToolTip(item:Object):String{
var myString:String = "";
if(item != null)
{
myString = myString + "Firstname : " + item.fname + "\n";
myString = myString + "Lastname : " + item.lname + "\n"
}
return myString;
}
]]>
</mx:Script>
<mx:DataGrid id="dGrid" dataProvider="{myData}" visible="true" dataTipFunction="buildToolTip">
<mx:columns>
<mx:DataGridColumn dataField="fname" headerText="FirstName" showDataTips="true" />
<mx:DataGridColumn dataField="lname" headerText="LastName" showDataTips="true" />
</mx:columns>
</mx:DataGrid>
</mx:Application>
'개발 > FLEX & AIR' 카테고리의 다른 글
BitmapData를 PNG나 JPG로 변환하여 ByteArray로 서버에 전송하는 방법 (0) | 2011.01.13 |
---|---|
air를 이용한 SQLlite 사용하기 (0) | 2011.01.13 |
[Flex] flex Image, bitmap등의 결과물을 인쇄 및 저장하기 (0) | 2010.08.25 |
[FLEX] Flex 상에서 stage가 null 일경우 (0) | 2010.08.20 |
[Flex] Flex Default Background Color (0) | 2010.08.17 |