Delete Record From Datagrid

Using the example from Negatyve http://www.experts-exchange.com/Web/WebDevSoftware/Flash/Q_21180897.html , does anyone know how to delete a record from the database using the datagrid? If so, can you please provide and example or point me in the right direction.  Any help would be greatly appreciated.  Thanks in adavance.

Justice
Justice75Asked:
Who is Participating?
 
negatyveConnect With a Mentor Commented:
0
 
Justice75Author Commented:
The example that I am refering to is using the LoadVars object not the XML emaple.  Thanks.
0
 
Justice75Author Commented:
Okay?

Can anyone show me how to get the value of a record that was loded into a datagrid.  I think that I can send it the ASP page an ddelete the record.  However, how do I reload the datagrid?  Would I reload the loadVars object once the record ID (MMID) is sent to the ASP page.  Well I guess that I can just experiment once I figure out how to get the value of teh reord id from the selected record.  I have included the AS file.  Thanks for any help.

Justice


AS:
//this code checks the main swf root to see if the user has logged in
     if (_root.logged.text ==""){
          status.text = "YOU MUST BE LOGGED IN TO ACCESS YOUR MESSAGES";
          } else {
          status.text = "";
          }
//load vars
data_var = new LoadVars();
//any number can be plugged in here- the main swf root supplies this to this swf and passes it to the asp page that selects
//the records based on this value
data_var.ID = _root.logged.text;
data_var.path = this;
data_var.onLoad = function(success)
{
     if(success){
          var dataProv = [];
          for(var i = 0; i < Number(this.tot); i++){
               var item = {};
               item.Date = this["MMDate" + i];
               item.ID     = this["MMID" + i];
               item.From     = this["FromID" + i];
               item.Subject = this["Subject" + i];
               item.Message = this["Message" + i];
               item.Total = this["tot"];
               
               dataProv.push(item);
          }

          //counter
          iMCounter.text = item.Total;
         
          //column names, column info and dataProvider
          this.path.data_dg.columnNames = ["Date", "ID", "From", "Subject"];
          this.path.data_dg.dataProvider = dataProv;

          this.path.data_dg.getColumnAt(0).width = 150;
          this.path.data_dg.getColumnAt(1).width = 30;
          this.path.data_dg.getColumnAt(2).width = 50;
          this.path.data_dg.getColumnAt(3).width = 140;
         
}    
}

data_var.sendAndLoad("http://localhost/PartyList/Pages/Profile/proMVLoad.asp", data_var, "POST");


myGridListener = new Object();
myGridListener.change = function (eventObj)
{
     var eventSource = eventObj.target;
     var theSelectedItem = eventSource.selectedItem;
     var theSelectedItemMessage = theSelectedItem.Message;
     info.text = "Message:  " + theSelectedItemMessage;
};
data_dg.addEventListener("change", myGridListener);
stop();
0
Take Control of Web Hosting For Your Clients

As a web developer or IT admin, successfully managing multiple client accounts can be challenging. In this webinar we will look at the tools provided by Media Temple and Plesk to make managing your clients’ hosting easier.

 
negatyveCommented:
Actually, what aren't you able to do?
0
 
Justice75Author Commented:
WOW Hi Negatyve!,

I want to be able to delete a record using the example that you provided.  I added a few extra lines of code and a text area bu it's the same code.  Thanks a bunch for  your time.

Justice

0
 
negatyveCommented:
ok, gimme time to make you an example.. :)
0
 
Justice75Author Commented:
ok thanks
0
 
Justice75Author Commented:
Thanks Alot
0
All Courses

From novice to tech pro — start learning today.