For applications written using Delphi For PHP, PlatinumGrid is a drag-and-drop component with complete
integration into the VCL For PHP. This page is intended for the developers who do not use
Delphi For PHP, to demonstrate the easy API that PlatinumGrid provides.
Basic Grid:
The first example is just a basic grid, showing the records in a dataset.
<?php
require_once( 'grid.inc.php' );
$dbConnection = mysql_connect( 'localhost', 'root', '' );
mysql_select_db( 'gridsamples', $dbConnection );
$dataSource = new MySQLDatasource( $dbConnection );
$dataSource->DataSet->TableName = 'employeestiny';
$dataSource->DataSet->Open();
// Construct the grid.
$grid = new JTPlatinumGrid();
$grid->Datasource = $dataSource;
$grid->Height = '';
$grid->SiteTheme->Theme = 'default';
$grid->init();
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>Basic Demo</title>
<?php $grid->dumpHeaderCode(); ?>
</head>
<body>
<form action="" method="post">
<div id="<?php echo( $grid->Name ); ?>_outer">
<?php $grid->dumpContents(); ?>
</div>
</form>
</body>
</html>
Copyright © JomiTech 2009. All Rights Reserved. |
Privacy Policy