Structures_DataGrid
[ class tree: Structures_DataGrid ] [ index: Structures_DataGrid ] [ all elements ]

Class: Structures_DataGrid

Source Location: /Structures_DataGrid-0.5.1/DataGrid.php

Class Overview

Structures_DataGrid_Core
   |
   --Structures_DataGrid_Renderer
      |
      --Structures_DataGrid

Structures_DataGrid Class


Author(s):

Version:

  • $Revision: 1.4 $

Methods


Inherited Variables

Inherited Methods

Class: Structures_DataGrid_Renderer

Structures_DataGrid_Renderer::Structures_DataGrid_Renderer()
Constructor
Structures_DataGrid_Renderer::getRenderer()
Get Renderer
Structures_DataGrid_Renderer::render()
Render
Structures_DataGrid_Renderer::setRenderer()
Set Renderer

Class: Structures_DataGrid_Core

Structures_DataGrid_Core::Structures_DataGrid_Core()
Constructor
Structures_DataGrid_Core::addColumn()
Adds a DataGridColumn object to this DataGrid object
Structures_DataGrid_Core::addRecord()
Adds a DataGrid_Record object to this DataGrid object
Structures_DataGrid_Core::bind()
A simple way to add an associative array record set to the data grid.
Structures_DataGrid_Core::dropRecord()
Drops a DataGridRecord object from this DataGrid object
Structures_DataGrid_Core::getCurrentPage()
Retrieves the current page number when paging is implemented
Structures_DataGrid_Core::setCurrentPage()
Define the current page number. This is used when paging is implemented
Structures_DataGrid_Core::sortRecordSet()
Sorts the records by the defined field.

Class Details

[line 67]
Structures_DataGrid Class

A PHP class to implement the functionality provided by the .NET Framework's DataGrid control. This class can produce a data driven list in many formats based on a defined record set. Commonly, this is used for outputting an HTML table based on a record set from a database or an XML document. It allows for the output to be published in many ways, including an HTML table, an HTML Template, an Excel spreadsheet, an XML document. The data can be sorted and paged, each cell can have custom output, and the table can be custom designed with alternating color rows.

Quick Example: <?php require('Structures/DataGrid.php'); $dg = new Structures_DataGrid(); $result = mysql_query('SELECT * FROM users'); while ($rs = mysql_fetch_assoc($result)) { $dataSet[] = $rs; } $dg->bind($dataSet); echo $dg->render(); ?>



[ Top ]


Method Detail

Structures_DataGrid (Constructor)   [line 80]

void Structures_DataGrid( [string $limit = null], [string $page = 1], [string $renderer = DATAGRID_RENDER_TABLE])

Constructor

Acts somewhat as a factory and instantiates the Renderer and the Core

  • Access: public

Parameters:

string   $limit   —  The row limit per page.
string   $page   —  The current page viewed.
string   $renderer   —  The renderer to use.

[ Top ]

dump   [line 94]

void dump( )

Method used for debuging purposes only. Displays a dump of the DataGrid object.
  • Access: public

[ Top ]


Documentation generated on Mon, 11 Mar 2019 13:52:07 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.