Felipe, 
  Thank you!  I thought about doing it that way too but I didn't know enough 
Flex and actionscript to make that happen.

  Can I ask you another question?  What if I wanted to disable (gray out) a row 
in the cfgrid when 'selectmode="edit"'?
 

-----Original Message-----
From: Felipe Fernandes [mailto:[EMAIL PROTECTED] 
Sent: Friday, December 02, 2005 8:42 AM
To: CF-Talk
Subject: Re: cfgrid flash form question

Nick, the best way is to use a cfinput type="button" to delete the
rows insted of the auto genereted del of the grid.
This code also popup´s an confirmation alert to confirm the delete:


<cfsavecontent variable="actionDelete">
 var batchType = batchType
        var myClickHandler = function (evt)
        {
        if (evt.detail == mx.controls.Alert.YES)
        {               
        var item = batchType.selectedItem;
        if(_global.backupDP != undefined)
        {
                for(var i = 0; i < _global.backupDP.length; i++)
                {
                        if(_global.backupDP[i] == item)
                        {
                                _global.backupDP.removeItemAt(i);
                        }
                }
        }
        GridData.deleteRow(batchType);
        }
        }
        
        //set the font color and button labels of all alerts
        _global.styles.Alert.setStyle("color", 0xFF0000);
        mx.controls.Alert.cancelLabel = "No!";
        mx.controls.Alert.yesLabel = "Yes";
        
        //create the alert
        var qtexto = 'Tem certeza que deseja excluir o livro \n\n' +
batchType.selectedItem.titulo.toUpperCase();
        var myAlert = mx.controls.Alert.show(qtexto, "Confirmação",
        mx.controls.Alert.YES | mx.controls.Alert.CANCEL,  box1, 
myClickHandler);
</cfsavecontent>

And the button would be something like this:

     <cfinput type="button" name="removesub" value="Excluir"
onclick="#actionDelete#" enabled="{(batchType.selectedItem.id !=
undefined && batchType.selectedItem.id != 'what you don´t want it to
be')}" />

I used the batchType.selectedItem.id but I don´t know the columns of
your grid so you may have to change  the 'id' for some existing row.
If you want the code to do the insert button just ask.

Felipe



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Logware (www.logware.us): a new and convenient web-based time tracking 
application. Start tracking and documenting hours spent on a project or with a 
client with Logware today. Try it for free with a 15 day trial account.
http://www.houseoffusion.com/banners/view.cfm?bannerid=67

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:225957
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to