constructor Structures_DataGrid::Structures_DataGrid

constructor Structures_DataGrid::Structures_DataGrid() – Constructor


require_once 'Structures/DataGrid.php';

void constructor Structures_DataGrid::Structures_DataGrid ( string $limit = null , int $page = null , string $rendererType = null )


Builds the DataGrid class. The Core functionality and Renderer are separated for maintainability and to keep cohesion high.


string $limit

The number of records to display per page.

integer $page

The current page viewed. In most cases, this is useless. Note: if you specify this, the "page" GET variable will be ignored.

string $rendererType

The type of renderer to use. You may prefer to use the $type argument of render() , fill() or getOutput()


throws no exceptions thrown



// Don't forget the ampersand
$datagrid =& new Structures_DataGrid();


This function can not be called statically.

Class Structures_DataGrid (Previous) Add a column, with optional position (Next)
Last updated: Sat, 10 Oct 2015 — Download Documentation
Do you think that something on this page is wrong? Please file a bug report or add a note.
View this page in:

User Notes:

Note by:
Q: How can i customize rendering without doing AttachRenderer of say a custom renderer ?

A: The default renderer (HTML_Table) can be customized as in this code fragment:

// bind to CSV source data
$dg->bind($csvFile, $options, 'CSV');

// customize the HTML_TABLE (default renderer's) output
$render = $dg->getRenderer();
$htab = $render->getContainer();
$htab->setCaption( sprintf( "DJIA snapped on %s",
date('Y-M-d', fileatime($csvFile) ) ),
"align='bottom'" );
// render datagrid as HTML table

so you are then presented with any formatting capability provided by the previously instantiated default renderer