Structures_DataGrid::fill() – Fill a rendering container with data


require_once 'Structures/DataGrid.php';

mixed Structures_DataGrid::fill ( object &$container , array $options = array() , string $type = null )


This package is not documented yet.


object &$container

A rendering container of any of the supported types (example: an HTML_Table object, a Spreadsheet_Excel_Writer object, etc...)

array $options

Options for the corresponding rendering driver

string $type

Explicit type in case the container type can't be detected

Return value

returns Either true or a PEAR_Error object


throws no exceptions thrown


Filling a Pager object


require_once 'Pager/Pager.php';

// Create a Pager object with your own options
$pager =& Pager::factory($options);

// fill() sets the $pager object up, according to your data and settings

// Render the paging links
echo $pager->links;

// Or a select field if you like that
echo $pager->getpageselectbox();


Fill a form with sort fields

require_once 'HTML/QuickForm.php';

// Create an empty form with your settings
$form = new HTML_QuickForm('myForm''POST');

// Customize it, add a header, text field, etc..
$form->addElement('header'null'Search & Sort Form Example');
$form->addElement('text''my_search''Search for:');

// Let the datagrid add sort fields, radio style
$options = array('directionStyle' => 'radio');

// You must add a submit button. fill() never does this

// Use the native HTML_QuickForm::display() to print your form



This function can not be called statically.

Enable streaming support for reading from DataSources and writing with Renderers and set the buffer size (number of records) (Previous) Generate columns from a fields list (Next)
Last updated: Sat, 16 Feb 2019 — Download Documentation
Do you think that something on this page is wrong? Please file a bug report.
View this page in:
  • English

User Notes:

There are no user contributed notes for this page.