:: Forum >> Version 1 >>

Selecting a row and then pass parameters

Hi,

I am looking for a working example that will show me how to select a record from a table (either by double clicking or via a FORM submition or some other method) that will the take the the selected record value and pass it to another page.

For example, I have a table of records of letters of the alpha bet (a,b,c etc) and I want to amend or delete "d". How do I select the table row for "d" and then pass these parameters to another page where the record is either amended or deleted.

If anyone can help, I would greatly apprciate it as I have been pulling my hair out over this one!

Many thanks,

Michael
Michael
Friday, May 13, 2005
Hi Michael,
If you have the solution pleaste post it here
Octavianus
Monday, April 17, 2006
Michael:

There's not much specific to go no, but here are my assumption: you want to move when double-clicking a specific row and you need to pass two parameters, which are found in columns 0 and 6. You have a javascript data array called myData.

myGrid.onRowDoubleClicked = function( eventindex ) { 
   var 
P1 myData[index][0];
   var 
P2 myData[index][6];
   
window.location "yyy.zzz?P1=" P1 +"&P2=" P2;
};
 
Now, this is not "AJAX"-like.

myGrid.onRowDoubleClicked = function( eventindex ) {
    var 
= new AW.HTTP.Request;
    
r.setURL("yyy.zzz");
    
r.setRequestMethod("POST");
    
r.setParameter("P1"myData[row][0] );
    
r.setParameter("P2"myData[row][6] );
    
r.request();
    
r.response = function( data ) {
        
// code to handle success or fail based of data returned
    
}
}
 
Paul Tiseo
Monday, April 17, 2006
Hmm. I meant to say the first code snippet is not AJAX-like. If you want it more AJAX-like, you'd need something along the lines of the bottom snippet. Also, if you are not using a js array for data, you'll have to use different code. But, the general idea is the same...
Paul Tiseo
Monday, April 17, 2006



This topic is archived.

Back to support forum

Forum search