How to accessing item renderers in action script??
hi
i working on itemrenderes in flex!
i have link button component item renderer inside 1 of data grid column, please find piece below!
now how make item render invisible once click on it!
we need make link button invisible user!
let me know how access this!
public function onclick():void {
// use our custom component template popup window
var confirmwindow:titlewindow = titlewindow(popupmanager.createpopup(this, confirmationpopup, true));
// need take care of yes response since don't have anything
// if response no
confirmwindow.addeventlistener("selectedyes", function():void {
//alert.show("can upgraded alarm");
upgradeeventtoanalarm();
});
confirmwindow.addeventlistener("selectedno", function():void {
});
}
public function upgradeeventtoanalarm():void
{
eventro = new remoteobject();
eventro.destination = "eventbrowser";
eventro.upgradeeventtoalarm.addeventlistener("result",getresulthandler);
eventro.addeventlistener("fault", getfaulthandler);
eventro.upgradeeventtoalarm(eventsdatagrid.selecteditem.id);
}
private function getresulthandler(event:resultevent):void
{
//eventsdatagrid.dataprovider.removeitemat(eventsdatagrid.selectedindex)
if(event.result == true)
{
here need access link button clicked , need make invisible
alert.show("successfully upgraded alarm");
}
else
{
alert.show("cannot upgraded alarm");
}
}
//fault handler.
private function getfaulthandler(event:faultevent):void
{
alert.show(event.fault.faultstring, 'error');
}
]]>
</mx:script>
<mx:tabnavigator x="24" y="25" width="95%" height="90%"
stylename="mytabnavigator" horizontalgap="-20" backgroundcolor="#e6e4e5">
<mx:canvas label="view" width="100%" height="100%" >
<mx:datagrid id="eventsdatagrid" dataprovider="{mymodel.eventslist}"
height="90%" width="98%" x="10" y="23" >
<mx:columns>
<!-- <mx:datagridcolumn id="iconflagid" headertext="iconflag"
datafield="iconflag" visible="false"/>-->
<mx:datagridcolumn headertext="eventid" datafield="id" visible="false"/>
<mx:datagridcolumn headertext="event name" datafield="eventname"/>
<mx:datagridcolumn id="catfieldid" headertext="category"
datafield="category"/>
<mx:datagridcolumn headertext="alarmname" datafield="alarmname"/>
<mx:datagridcolumn headertext="severity" datafield="severity"/>
<mx:datagridcolumn headertext="source" datafield="source"/>
<mx:datagridcolumn headertext="updated time" datafield="updatetime"/>
<mx:datagridcolumn headertext="description" datafield="description"/>
<mx:datagridcolumn id="upgradelinkbuttonid"
headertext="upgrade alarm" datafield="iconflag">
<mx:itemrenderer>
<mx:component>
<mx:box height="100%" width="100%">
<mx:linkbutton id="eventslinkbuttonid" textdecoration="underline"
icon="@embed(source='assets/eventsbrowser/images[97]1.jpg')"
click="outerdocument.onclick();" visible="{!data.iconflag}"
textalign="center" includeinlayout="true">
</mx:linkbutton>
</mx:box>
</mx:component>
</mx:itemrenderer>
</mx:datagridcolumn>
</mx:columns>
</mx:datagrid>
thanks in advance
aruna.s.n.
here, try use viewstack like
< viewstack selectedindex=0
<linkbutton>
<label>
<viewstack >
once click on linkbutton, make selectedindex viewstack 1, hide linkbutton & show blank label.
More discussions in Archived Spaces
adobe
Comments
Post a Comment