PDA

View Full Version : Itemrenderer underline is not working


sipra
04-24-2009, 08:37 AM
Hi All,

I have a datagrid and have a column company name.I am using the itemrenderer on company name column.Now those companies have website link in database have underline and those have no website then no underline.My problem is in itemrenderer i'm using the label,code is below :
<mx:VBox xmlns:mx="http://www.adobe.com/2006/mxml" horizontalScrollPolicy="off" verticalScrollPolicy="off">
<mx:Script>
<![CDATA[
import mx.core.Application;
import mx.controls.Alert;
import flash.net.URLRequest;
import flash.net.navigateToURL;
import mx.controls.Text;

public function chk():void
{

if(data.website1!=''){
ins.setStyle("textDecoration","underline");//Alert.show(""+ins.getStyle("textDecoration"));
ins.mouseChildren=false;
ins.buttonMode=true;
ins.useHandCursor=true;
}
if(data.website1==''){
ins.setStyle("textDecoration","underline");
ins.mouseChildren=true;
ins.buttonMode=false;
ins.useHandCursor=false;
}
}

private function gettext(e:MouseEvent):void
{
//Alert.show(""+data.website);
//Alert.show(""+e.currentTarget.text);
if(data.website1!=''){
var datavalue:int=int(data.website1);
var urlstr:String=""+datavalue;
var urlrequest:URLRequest= new URLRequest(data.website1);

navigateToURL(urlrequest,"_blank");
}
}
]]>
</mx:Script>
<mx:Text id="ins" creationComplete="chk()" text="{data.co_name1}" toolTip="{data.co_name1}" click="gettext(event)" textAlign="left" width="100%"/>

</mx:VBox>

But the underline and none is not working properly.
Please help thanks in advance.