This demo shows the use of the item template
| ID | Summary |
|---|---|
| 1 |
Title: Item 1 Category: 3 Author: Dennis |
| 2 |
Title: Item 2 Category: 5 Author: John |
| 3 |
Title: Item 3 Category: 2 Author: Chris |
| 4 |
Title: Item 4 Category: 3 Author: Jeremy |
| 5 |
Title: Item 5 Category: 6 Author: Chris |
| 6 |
Title: Item 6 Category: 5 Author: John |
| 7 |
Title: Item 7 Category: 3 Author: Dennis |
| 8 |
Title: Item 8 Category: 7 Author: Chris |
| 9 |
Title: Item 9 Category: 8 Author: Dennis |
| 10 |
Title: Item 10 Category: 3 Author: Jeremy |
| 11 |
Title: Item 11 Category: 9 Author: Dennis |
| 12 |
Title: Item 12 Category: 3 Author: John |
| 13 |
Title: Item 13 Category: 2 Author: Chris |
| 14 |
Title: Item 14 Category: 1 Author: Dennis |
| 15 |
Title: Item 15 Category: 5 Author: John |
| 16 |
Title: Item 16 Category: 3 Author: Jeremy |
<?php
include ('phpdatagrid.php');
// Include Sample data
include ('sampledata.php');
// Bind data to datagrid
$_DATAGRID->bind ('demo', $data);
?>
<html>
<head>
<title>PHP:DataGrid - Demo 5</title>
</head>
<body>
<h1>Simple PHP:DataGrid Template Demo</h1>
<p>This demo shows the use of the item template</p>
<hr />
<php:datagrid name="demo" width="50%" AutoGenerateColumns="false" cellpadding="5" cellspacing="0" border="true">
<Style font-family="Verdana" background-color="#eeeeee" font-size="12px" />
<HeaderStyle Background-Color="#000" bold="true" text-color="#fff" />
<AlternateItemStyle background-color="#fff" />
<Column datafield="id" HeaderText="ID" />
<Column name="summary" HeaderText="Summary" ItemStyle-text-align="center">
<ItemTemplate>
<strong>Title: </strong> {item:title}<br />
<strong>Category: </strong> {item:category}<br />
<strong>Author: </strong> {item:author}<br />
</ItemTemplate>
</Column>
</php:datagrid>
<hr />
<h2>Source:</h2>
<div style="background-color: #EFEFEF;"><?php highlight_file(__FILE__); ?></div>
</body>
</html>