addButtonToRow
By default the GET parameter for the primary key is passed to the page with the id being the primary key value. However, you can use the word "ALL" as an optional third parameter to have ALL fields and their values passed!
Details
Type | function |
---|---|
Returns | void |
Default | no button |
Parameters
- buttonValue
- Value for the button
- URL
- a web script (eg a php, .asp, .jsp file)
Example
$tblDemo->addButtonToRow("View", "myOwnDisplayPage.php");
OR
//this second example will pass ALL fields to the update form page
$tblDemo->addButtonToRow("Edit", "myOwnUpdateForm.php", "all");
OR
//this third example will pass only the "myDBField" variable (and value) to the update page
$tblDemo->addButtonToRow("Edit", "myOwnUpdateForm.php", "myDBField");
OR
//this fourth example will pass in the name of a user-defined JavaScript function which will allow the page to open up in specific window
<?php
$mytable->addButtonToRow("View", "", "", "myJavascriptFunctionToOpenInNewWindow");
?>
.
.
.
<script>
function myJavascriptFunctionToOpenInNewWindow(id){
alert('opening new window');
window.open('test.php?courseid=' + id');
}
</script>