i am using spark datagrid for my application. i am using one cusomrenderer (contains one link) for my spark datagrid.Text in the columns are truncated with respect to it's column size.but the link is not truncated, it is overlapped to next column ,that is not fair.i want that link column should be truncated within its column.here i have given my sample code.
<?xml version="1.0" encoding="utf-8"?>
<s:Application name="Spark_DataGrid_columns_test"
xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx" creationComplete="init()">
<fx:Script>
<![CDATA[
import mx.controls.Alert;
import spark.components.Grid;
import spark.components.gridClasses.CellPosition;
private function init():void
{
var link:ClassFactory = new ClassFactory(sparkLinkRenderer);
linkColumn.itemRenderer = link;
}
]]>
</fx:Script>
<fx:Declarations>
<s:ArrayList id="TweetersList">
<fx:Object drink="onetqwo three four five six seven eight" name="Dan Florio" twitter="polyGeek polyGeek polyGeek polyGeek polyGeek" />
<fx:Object drink="one" name="David Ortinau" twitter="davidortinau" />
<fx:Object drink="one" name="Simeon Bateman" twitter="simBateman"/>
<fx:Object drink="one" name="Dan Florio" twitter="polyGeek" />
<fx:Object drink="one" name="David Ortinau" twitter="davidortinau" />
<fx:Object drink="one" name="Simeon Bateman" twitter="simBateman" />
<fx:Object drink="one" name="Dan Florio" twitter="polyGeek" />
<fx:Object drink="one" name="David Ortinau" twitter="davidortinau" />
<fx:Object drink="one" name="Simeon Bateman" twitter="simBateman" />
<fx:Object drink="one" name="Dan Florio" twitter="polyGeek" />
<fx:Object drink="one" name="David Ortinau" twitter="davidortinau"/>
<fx:Object drink="one" name="Simeon Bateman" twitter="simBateman"/>
</s:ArrayList>
</fx:Declarations>
<s:DataGrid id="spdg" width="500" height="250" >
<s:columns>
<s:ArrayList>
<s:GridColumn width="100" id="linkColumn" dataField="drink"/>
<s:GridColumn width="100" dataField="name"/>
<s:GridColumn width="100" dataField="twitter"/>
</s:ArrayList>
</s:columns>
</s:DataGrid>
</s:Application>
the link custom renderer code:
<?xml version="1.0" encoding="utf-8"?>
<s:GridItemRenderer xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:mx="library://ns.adobe.com/flex/mx"
xmlns:s="library://ns.adobe.com/flex/spark"
width="100%" >
<fx:Script>
<![CDATA[
override public function set data(value:Object):void
{
super.data = value;
linkButton.label = value.drink;
}
]]>
</fx:Script>
<mx:LinkButton id="linkButton" color="#170909" textAlign="left" fontWeight="normal" textDecoration="underline">
</mx:LinkButton>
</s:GridItemRenderer>
sample snapshot of my output:
please suggest me on this issue.
thanks in advance, vengatesh