|
|
A DataGrid Web control Using
Web Components Web controls
(extended for use in php.MVC)
DataGrid Demo
(Session handling is broken again on the PHP hosting server :(
I'll try to get Rackhost to upgrage the PHP version ASAP)
Usage:
(This Web control uses session cookies to maintain
the grid state.)
----- myPage.php -------------------------------------
<?php
include_once 'MVC_OOHControls.php';
include_once './CustAndOrders.dat'; // $custArray and $orderArray
session_name('wform');
session_start();
// Object Oriented wrapper for plug-in Web Controls
$mvcOOHControls = new MVC_OOHControls;
// Setup the Customers control
$colheaders =
array(
array(0, 'Cust ID' , '#ffffff', '50' , '0'),
array(1, 'Company Name', '#ffffff', '150', '0'),
array(2, 'City' , '#ffffff', '150', '0')
);
$mvcOOHControls->addControl(
array('type' => 'W_StrGrid',
'id' => 'strGrid01',
'name' => 'Customers',
'charset' => 'ISO-8859-2',
'show_selected'=> True,
'oneline' => True,
'max' => 5,
'width' => 375,
'height' => 370,
'ret_as_id' => 'Cust ID',
'colheaders' => $colheaders
)
);
// Add some data
$fkey = '';
$mvcOOHControls->arrayDataSource('strGrid01', $custArray, $fkey);
?>
<!-- Display the controls -->
<b>Customers:</b>
<?php $mvcOOHControls->showControl('strGrid01', ''); ?>
------------------------------------------------------
Check out all 24 Web controls by the Web Components group
on SourceForge
http://sourceforge.net/projects/webcomp/.
|
|