How Do You Apply A URL Link To Each Row?
How Do You Apply A URL Link To Each Row?
Patrick E
July 28,
Ha, I just did this yesterday....
just put an extra data column in, which the grid doesn't display, but which has your link info in it.
// set selection chaged handler
obj_usergrid.setAction("selectionChanged", scHandler);
var scHandler = function() {
var selectionIndex = this.getSelectionProperty("index");
if(selectionIndex != null) {
var linkCol = this.getDataProperty("text", selectionIndex, 2);
document.location = linkCol;
}
}
obj_usergrid.setAction("selectionChanged", scHandler);
Brianj
July 29,
Hi Brian,
I don't suppose you could post a full example of this cold you? I'm hoping to display a list of client information in the table with a double click to display asn input form to edit the record.
I haven't quite got my head around where everything fits in with each other so an example would be great (please).
Thanks in advance.
Alan G-B
August 6,
following code for php and grid to show grid with link.
just replace <script> .... </script> <? include("connection.inc");
print '<script> ';
$qry = "select a.code, a.fname, a.lname, a.lab, a.ppno, a.visano, a.visadate, a.doi, a.gamca_id, b.name, a.accept, a.uniqses from " . $_SESSION['datayear']. " a, company b where a.agency = b.compcode ". $condition . " order by substring(a.code,3)";
$result=mysql_query($qry);
$cstring = ' var myData = [' ;
$tt = mysql_num_rows($result);
while($row=mysql_fetch_array($result)){
$cstring=$cstring . '["'. $row['code'] .'", "<a href=test.php?'.$row['code'].'>' . $row['fname'] .'</a>", "' . $row['lname'] . '", "'. $row['lab'] . '", "' . $row['ppno'] .'","'. $row['visano'] . '", "' . $row['visadate'] .'","' .$row['doi']. '","'.$row['gamca_id']. '","'.$row['name']. '","<a href=singleview.php?' . $row['uniqses'].' target=_blank>' ;
$filename = "2006/" . substr($row['ppno'], -1, 1) ."/". $row['ppno'] . '.GIF' ;
if (file_exists($filename)){
$exist = $row['accept'] ;
}
else{
$exist="<B> ". $row['accept'] . "</B>";
}
$cstring=$cstring . $exist .'</a>"],' ;
}
$cstring=substr($cstring,0,strlen($cstring)-1) ."]; " ;
print $cstring ;
?>
var myColumns = [
"Code", "First Name", "Last Name", "Clinic", "Visa No", "Visa Date","Passport","DOI","Gamca Id","Agency", "A"];
</script>
varsha shakya, varsha_shakya@yahoo.com
January 31,