Simple PHP:DataGrid Editing Demo

This demo shows the inline editing capability.


ID Title Category Author
1 Item 1 3 Dennis Edit
2 Item 2 5 John Edit
3 Item 3 2 Chris Edit
4 Item 4 3 Jeremy Edit
5 Item 5 6 Chris Edit
6 Item 6 5 John Edit
7 Item 7 3 Dennis Edit
8 Item 8 7 Chris Edit
9 Item 9 8 Dennis Edit
10 Item 10 3 Jeremy Edit
11 Item 11 9 Dennis Edit
12 Item 12 3 John Edit
13 Item 13 2 Chris Edit
14 Item 14 1 Dennis Edit
15 Item 15 5 John Edit
16 Item 16 3 Jeremy Edit

Source:

<?php
include ('phpdatagrid.php');

// Include Sample data
include ('sampledata.php');

// Bind data to datagrid
$_DATAGRID->bind ('demo'$data);

?>
<html>
    <head>
        <title>PHP:DataGrid - Demo 6</title>
    </head>

    <body>

    <h1>Simple PHP:DataGrid Editing Demo</h1>

    <p>This demo shows the inline editing capability.</p>

    <hr />

    <?php
    
if (DG_ACTION == 'update') {
        echo 
"<strong>Updated Value's:</strong><br /><br />";
        echo 
"<strong>Title: </strong>" htmlentities($_DATAGRID->update['title']) . "</br >";
        echo 
"<strong>Category: </strong>" htmlentities($_DATAGRID->update['category']) . "</br >";
        echo 
"<strong>Author: </strong>" htmlentities($_DATAGRID->update['author']) . "</br ><br />";
    }
    
?>

    <php:datagrid name="demo" width="100%" 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" readonly="true" HeaderText="ID" />
        <Column datafield="title" HeaderText="Title" />
        <Column datafield="category" HeaderText="Category" />
        <Column datafield="author" HeaderText="Author" />
        <Link name="edit" action="edit" text="Edit" ItemStyle-text-align="center" />
    </php:datagrid>

    <hr />

    <h2>Source:</h2>
    <div style="background-color: #EFEFEF;"><?php highlight_file(__FILE__); ?></div>
    
    </body>
</html>