Or dont put the button at all... Allow the user to select one or many rows and 
have one delete button at the bottom of the DataGrid. The way you are doing it 
is a la HTML, think different :)
 
Dimitrios Gianninas
Developer
Optimal Payments Inc.
 

________________________________

From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of Ravi 
Kumar Gummadi
Sent: Tuesday, March 13, 2007 1:22 AM
To: [email protected]
Subject: RE: [flexcoders] Need a hand with a scope problem



Have the function placed in the script section of parentDocument a.l.a  the 
document which contains this mxml file or the parentApplication a.l.a the 
Application tag which contains the whole app.

<mx:Button label="" icon="@Embed('../images/delete.png')" 
click="parentDocument.deleteRow( data.tld );" />

<mx:Button label="" icon="@Embed('../images/delete.png')" 
click="parentApplication.deleteRow( data.tld );" />

Even I faced the same problem, If anyone can suggest  a way to access the code 
placed in the same mxml file, it would be really helpful

 

Hope this helps,

 

Cheers,
Ravi Gummadi

PartyGaming Plc

 

________________________________

From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of 
Alexandre Lemaire
Sent: Tuesday, March 13, 2007 10:44 AM
To: [email protected]
Subject: [flexcoders] Need a hand with a scope problem

 

Inside of an mxml file, I have a datagrid, with a Button item renderer as such:

 

 

<mx:DataGridColumn

headerText="delete" textAlign="center" editable="false"> 

<mx:itemRenderer> 

<mx:Component> 

<mx:VBox horizontalAlign="center"> 

<mx:Button label="" icon="@Embed('../images/delete.png')" /> 

</mx:VBox> 

</mx:Component> 

</mx:itemRenderer> 

</mx:DataGridColumn> 

 

 

In that Button, I would like to call a function that exists in the same .mxml 
file

 

 

public function deleteRow( id:String ):void{

}

 

Unfortunately, if I edit the button to read like:

<mx:Button label="" icon="@Embed('../images/delete.png')" click="deleteRow( 
data.tld );" />

It writes that the function deleteRow doesn't exist, which I imagine is a scope 
problem.  How do I get around this?

Thanks in advance,
Alex

 

-- 
WARNING
-------
This electronic message and its attachments may contain confidential, 
proprietary or legally privileged information, which is solely for the use of 
the intended recipient.  No privilege or other rights are waived by any 
unintended transmission or unauthorized retransmission of this message.  If you 
are not the intended recipient of this message, or if you have received it in 
error, you should immediately stop reading this message and delete it and all 
attachments from your system.  The reading, distribution, copying or other use 
of this message or its attachments by unintended recipients is unauthorized and 
may be unlawful.  If you have received this e-mail in error, please notify the 
sender.

AVIS IMPORTANT
--------------
Ce message électronique et ses pièces jointes peuvent contenir des 
renseignements confidentiels, exclusifs ou légalement privilégiés destinés au 
seul usage du destinataire visé.  L'expéditeur original ne renonce à aucun 
privilège ou à aucun autre droit si le présent message a été transmis 
involontairement ou s'il est retransmis sans son autorisation.  Si vous n'êtes 
pas le destinataire visé du présent message ou si vous l'avez reçu par erreur, 
veuillez cesser immédiatement de le lire et le supprimer, ainsi que toutes ses 
pièces jointes, de votre système.  La lecture, la distribution, la copie ou 
tout autre usage du présent message ou de ses pièces jointes par des personnes 
autres que le destinataire visé ne sont pas autorisés et pourraient être 
illégaux.  Si vous avez reçu ce courrier électronique par erreur, veuillez en 
aviser l'expéditeur.

Reply via email to