Claro_Utils_Datagrid Class Reference

Inheritance diagram for Claro_Utils_Datagrid:
Claro_Html_Element Claro_Renderer Claro_Utils_Autogrid Claro_Utils_Clarogrid

Public Member Functions

 __construct ($attributes=null)
 setTitle ($title)
 setFooter ($footer)
 setEmptyMessage ($emptyMessage)
 setRows (array $rows)
 prependColumn ($key, $label, $value)
 addColumn ($key, $label, $value)
 addDataColumn ($key, $label)
 getColumnsCount ()
 getRowsCount ()
 render ()

Protected Member Functions

 renderHeader ()
 renderBody ()
 renderFooter ()
 replace ($key, $value, $output)

Protected Attributes

 $lineNumber = 0
 $lineCount = 0
 $columnsLabels = array()
 $columnsValues = array()
 $columnsOrder = array()
 $rows = array()
 $title = ''
 $footer = ''
 $emptyMessage = ''

Detailed Description

Definition at line 19 of file datagrid.lib.php.


Constructor & Destructor Documentation

__construct ( attributes = null  ) 
Parameters:
array $attributes attributes of the table element

Definition at line 36 of file datagrid.lib.php.


Member Function Documentation

addColumn ( key,
label,
value 
)

Add a column at the end of the datagrid rows

Parameters:
string $key identifier of the column
string $label title of the column
string $value template or value of the collumn cells

Definition at line 97 of file datagrid.lib.php.

addDataColumn ( key,
label 
)

Add a column matching a given one in the data rows

Parameters:
string $key identifier of the column in the data rows
string $label title of the column

Definition at line 109 of file datagrid.lib.php.

getColumnsCount (  ) 

Get the number of columns

Returns:
int

Definition at line 118 of file datagrid.lib.php.

getRowsCount (  ) 

Get the number of rows

Returns:
int

Definition at line 127 of file datagrid.lib.php.

prependColumn ( key,
label,
value 
)

Add a column at the start of the datagrid rows

Parameters:
string $key identifier of the column
string $label title of the column
string $value template or value of the collumn cells

Definition at line 84 of file datagrid.lib.php.

render (  ) 
See also:
Claro_HTML_Element

Reimplemented from Claro_Html_Element.

Definition at line 206 of file datagrid.lib.php.

renderBody (  )  [protected]

Definition at line 151 of file datagrid.lib.php.

renderFooter (  )  [protected]

Definition at line 195 of file datagrid.lib.php.

renderHeader (  )  [protected]

Reimplemented in Claro_Utils_Clarogrid.

Definition at line 132 of file datagrid.lib.php.

replace ( key,
value,
output 
) [protected]

Replace the templates for a given data key by the rendered string for the given value in the given string For example if the key 'id' as the value 'zorg', id% will be replaced with 'zorg'

Parameters:
string $key
string $value
string $output
Returns:
string

Definition at line 222 of file datagrid.lib.php.

setEmptyMessage ( emptyMessage  ) 

Set the empty message displayed if the data rows are empty

Parameters:
string $emptyMessage

Definition at line 63 of file datagrid.lib.php.

setFooter ( footer  ) 

Set the table footer

Parameters:
string $footer content of the footer

Definition at line 54 of file datagrid.lib.php.

setRows ( array $  rows  ) 

Set the data rows

Parameters:
array $rows

Reimplemented in Claro_Utils_Autogrid.

Definition at line 72 of file datagrid.lib.php.

setTitle ( title  ) 

Set the table caption

Parameters:
string $title

Definition at line 45 of file datagrid.lib.php.


Field Documentation

$columnsLabels = array() [protected]

Definition at line 24 of file datagrid.lib.php.

$columnsOrder = array() [protected]

Definition at line 26 of file datagrid.lib.php.

$columnsValues = array() [protected]

Definition at line 25 of file datagrid.lib.php.

$emptyMessage = '' [protected]

Definition at line 31 of file datagrid.lib.php.

$footer = '' [protected]

Definition at line 30 of file datagrid.lib.php.

$lineCount = 0 [protected]

Definition at line 22 of file datagrid.lib.php.

$lineNumber = 0 [protected]

Definition at line 21 of file datagrid.lib.php.

$rows = array() [protected]

Definition at line 27 of file datagrid.lib.php.

$title = '' [protected]

Definition at line 29 of file datagrid.lib.php.


The documentation for this class was generated from the following file:
Generated on Tue Jun 8 12:28:38 2010 for Claroline API by  doxygen 1.6.3