Class JGrid

Description

JGrid class to dynamically generate HTML tables

  • since: 11.3

Located in /libraries/joomla/grid/grid.php (line 21)


	
			
Variable Summary
 array $columns
 array $options
 array $rows
 array $specialRows
Method Summary
 JGrid __construct ([array $options = array()])
 JGrid addColumn (string $name)
 JGrid addRow ([array $options = array()], [int $special = false])
 JGrid deleteColumn (string $name)
 JGrid deleteRow (int $id)
 int getActiveRow ()
 array getColumns ()
 array getRow ([int $id = false])
 array getRowOptions ()
 array getRows ([int $special = false])
 array getTableOptions ()
 string renderArea (array $ids, [string $area = 'tbody'], [string $cell = 'td'])
 string renderAttributes (array $attributes)
 JGrid setActiveRow (int $id)
 JGrid setColumns (array $columns)
 JGrid setRowCell (string $name, string $content, [array $option = array()], [bool $replace = true])
 JGrid setRowOptions (array $options)
 JGrid setTableOptions ([array $options = array()], [bool $replace = false])
 string toString ()
 string __toString ()
Variables
int $activeRow = 0 (line 35)

Current active row

  • since: 11.3
  • access: protected
array $columns = array() (line 28)

Array of columns

  • since: 11.3
  • access: protected
array $options (line 56)

Associative array of attributes for the table-tag

  • since: 11.3
  • access: protected
array $rows = array() (line 42)

Rows of the table (including header and footer rows)

  • since: 11.3
  • access: protected
array $specialRows = array('header' => array(),'footer'=>array()) (line 49)

Header and Footer row-IDs

  • since: 11.3
  • access: protected
Methods
Constructor __construct (line 65)

Constructor for a JGrid object

  • since: 11.3
  • access: public
JGrid __construct ([array $options = array()])
  • array $options: Associative array of attributes for the table-tag
addColumn (line 126)

Add new column name to process

  • return: This object for chaining
  • since: 11.3
  • access: public
JGrid addColumn (string $name)
  • string $name: Internal column name
addRow (line 194)

Adds a row to the table and sets the currently active row to the new row

  • return: This object for chaining
  • since: 11.3
  • access: public
JGrid addRow ([array $options = array()], [int $special = false])
  • array $options: Associative array of attributes for the row
  • int $special:
    1. for a new row in the header, 2 for a new row in the footer
deleteColumn (line 154)

Delete column by name

  • return: This object for chaining
  • since: 11.3
  • access: public
JGrid deleteColumn (string $name)
  • string $name: Name of the column to be deleted
deleteRow (line 359)

Delete a row from the object

  • return: This object for chaining
  • since: 11.3
  • access: public
JGrid deleteRow (int $id)
  • int $id: ID of the row to be deleted
getActiveRow (line 248)

Get the currently active row ID

  • return: ID of the currently active row
  • since: 11.3
  • access: public
int getActiveRow ()
getColumns (line 140)

Returns the list of internal columns

  • return: List of internal columns
  • since: 11.3
  • access: public
array getColumns ()
getRow (line 308)

Get all data for a row

  • return: Array of columns of a table row
  • since: 11.3
  • access: public
array getRow ([int $id = false])
  • int $id: ID of the row to return
getRowOptions (line 220)

Method to get the attributes of the currently active row

  • return: Associative array of attributes
  • since: 11.3
  • access: public
array getRowOptions ()
getRows (line 334)

Get the IDs of all rows in the table

  • return: Array of IDs
  • since: 11.3
  • access: public
array getRows ([int $special = false])
  • int $special: false for the standard rows, 1 for the header rows, 2 for the footer rows
getTableOptions (line 112)

Get the Attributes of the current table

  • return: Associative array of attributes
  • since: 11.3
  • access: public
array getTableOptions ()
renderArea (line 425)

Render an area of the table

  • return: The rendered table area
  • since: 11.3
  • access: protected
string renderArea (array $ids, [string $area = 'tbody'], [string $cell = 'td'])
  • array $ids: IDs of the rows to render
  • string $area: Name of the area to render. Valid: tbody, tfoot, thead
  • string $cell: Name of the cell to render. Valid: td, th
renderAttributes (line 457)

Renders an HTML attribute from an associative array

  • return: The HTML attribute string
  • since: 11.3
  • access: protected
string renderAttributes (array $attributes)
  • array $attributes: Associative array of attributes
setActiveRow (line 262)

Set the currently active row

  • return: This object for chaining
  • since: 11.3
  • access: public
JGrid setActiveRow (int $id)
  • int $id: ID of the row to be set to current
setColumns (line 176)

Method to set a whole range of columns at once This can be used to re-order the columns, too

  • return: This object for chaining
  • since: 11.3
  • access: public
JGrid setColumns (array $columns)
  • array $columns: List of internal column names
setRowCell (line 281)

Set cell content for a specific column for the currently active row

  • return: This object for chaining
  • since: 11.3
  • access: public
JGrid setRowCell (string $name, string $content, [array $option = array()], [bool $replace = true])
  • string $name: Name of the column
  • string $content: Content for the cell
  • array $option: Associative array of attributes for the td-element
  • bool $replace: If false, the content is appended to the current content of the cell
setRowOptions (line 234)

Method to set the attributes of the currently active row

  • return: This object for chaining
  • since: 11.3
  • access: public
JGrid setRowOptions (array $options)
  • array $options: Associative array of attributes
setTableOptions (line 92)

Method to set the attributes for a table-tag

  • return: This object for chaining
  • since: 11.3
  • access: public
JGrid setTableOptions ([array $options = array()], [bool $replace = false])
  • array $options: Associative array of attributes for the table-tag
  • bool $replace: Replace possibly existing attributes
toString (line 389)

Render the HTML table

  • return: The rendered HTML table
  • since: 11.3
  • access: public
string toString ()
__toString (line 77)

Magic function to render this object as a table.

  • since: 11.3
  • access: public
string __toString ()

Documentation generated on Tue, 19 Nov 2013 15:04:02 +0100 by phpDocumentor 1.4.3