Formatting data tips in a Slider
Flex SDK makes it very very easy, all you need to do to override the default data tip using the dataTipFormatFunction
property. By simply passing in the name of a user-defined function, you can format the data tip text however you want (such as prefixing dollar signs or what have you).
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
layout="vertical"
verticalAlign="middle"
backgroundColor="white">
<mx:Script>
<![CDATA[
private function formatFunction(item:Object):String {
return "Minium price: $" + item.toString();
}
]]>
</mx:Script>
<mx:HSlider id="slider"
width="200"
liveDragging="true"
minimum="1"
snapInterval="1"
tickInterval="1"
value="3"
dataTipFormatFunction="formatFunction" />
<mx:Label id="lbl" text="{slider.value}" />
</mx:Application>
11:17 AM
|
Labels:
Flex Controls Samples,
Flex Samples
|
This entry was posted on 11:17 AM
and is filed under
Flex Controls Samples
,
Flex Samples
.
You can follow any responses to this entry through
the RSS 2.0 feed.
You can leave a response,
or trackback from your own site.
0 comments:
Post a Comment