Structures_DataGrid (Previous) (Next) Structures_DataGrid_DataSource_CSV

View this page in Last updated: Sun, 28 Sep 2008
English | Dutch | French | German | Hungarian | Japanese | Polish | Russian | Spanish | Plain HTML

Structures_DataGrid_DataSource_Array

Structures_DataGrid_DataSource_Array -- Array Data Source Driver

Description

This class is a data source driver for a 2D array

General notes

This driver expects an array of the following form:

$data = array(0 => array('col0' => 'val00', 'col1' => 'val01', ...),
              1 => array('col0' => 'val10', 'col1' => 'val11', ...),
              ...
             );

The first level of this array contains one entry for each row. For every row entry an array with the data for this row is expected. Such an array contains the field names as the keys. For example, 'val01' is the value of the column with the field name 'col1' in the first row. Row numbers start with 0, not with 1.

Structures_DataGrid (Previous) (Next) Structures_DataGrid_DataSource_CSV

Download Documentation Last updated: Sun, 28 Sep 2008
Do you think that something on this page is wrong? Please file a bug report or add a note.
User Notes:
Note by: pierre.labrie@mediom.qc.ca
The 2D array should have only labels for the columns not for the rows.

Ex:

$datagrid =& new Structures_DataGrid();

$fruits = array (
array ("a"=>"orange", "b"=>"banane", "c"=>"pomme"),
array ("a"=>"citron", "b"=>"mangue", "c"=>"fraise"));

$test = $datagrid->bind($fruits,array(),'Array');