Joomla CMS  3.10.11 (avec JPlatform 13.1 inclus)
Documentation des API du CMS Joomla en version 3.10.11 et du framework Joomla Platform intégré
Tout Structures de données Espaces de nommage Fichiers Fonctions Variables Pages
Référence de la classe JGrid

Fonctions membres publiques

 __construct ($options=array())
 
 __toString ()
 
 setTableOptions ($options=array(), $replace=false)
 
 getTableOptions ()
 
 addColumn ($name)
 
 getColumns ()
 
 deleteColumn ($name)
 
 setColumns ($columns)
 
 addRow ($options=array(), $special=false)
 
 getRowOptions ()
 
 setRowOptions ($options)
 
 getActiveRow ()
 
 setActiveRow ($id)
 
 setRowCell ($name, $content, $option=array(), $replace=true)
 
 getRow ($id=false)
 
 getRows ($special=false)
 
 deleteRow ($id)
 
 toString ()
 

Fonctions membres protégées

 renderArea ($ids, $area='tbody', $cell='td')
 
 renderAttributes ($attributes)
 

Attributs protégés

 $columns = array()
 
 $activeRow = 0
 
 $rows = array()
 
 $specialRows = array('header' => array(), 'footer' => array())
 
 $options
 

Description détaillée

JGrid class to dynamically generate HTML tables

Depuis
1.7.3
Obsolète:
4.0 This class will be removed without any replacement

Documentation des constructeurs et destructeur

◆ __construct()

__construct (   $options = array())

Constructor for a JGrid object

Paramètres
array$optionsAssociative array of attributes for the table-tag
Depuis
1.7.3

Références $options.

Documentation des fonctions membres

◆ __toString()

__toString ( )

Magic function to render this object as a table.

Renvoie
string
Depuis
1.7.3

◆ addColumn()

addColumn (   $name)

Add new column name to process

Paramètres
string$nameInternal column name
Renvoie
JGrid This object for chaining
Depuis
1.7.3

Références $name.

◆ addRow()

addRow (   $options = array(),
  $special = false 
)

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

Paramètres
array$optionsAssociative array of attributes for the row
int$special1 for a new row in the header, 2 for a new row in the footer
Renvoie
JGrid This object for chaining
Depuis
1.7.3

Références $options.

◆ deleteColumn()

deleteColumn (   $name)

Delete column by name

Paramètres
string$nameName of the column to be deleted
Renvoie
JGrid This object for chaining
Depuis
1.7.3

Références $name.

◆ deleteRow()

deleteRow (   $id)

Delete a row from the object

Paramètres
int$idID of the row to be deleted
Renvoie
JGrid This object for chaining
Depuis
1.7.3

Références $id.

◆ getActiveRow()

getActiveRow ( )

Get the currently active row ID

Renvoie
int ID of the currently active row
Depuis
1.7.3

◆ getColumns()

getColumns ( )

Returns the list of internal columns

Renvoie
array List of internal columns
Depuis
1.7.3

Références $columns.

◆ getRow()

getRow (   $id = false)

Get all data for a row

Paramètres
int$idID of the row to return
Renvoie
array Array of columns of a table row
Depuis
1.7.3

Références $id.

◆ getRowOptions()

getRowOptions ( )

Method to get the attributes of the currently active row

Renvoie
array Associative array of attributes
Depuis
1.7.3

◆ getRows()

getRows (   $special = false)

Get the IDs of all rows in the table

Paramètres
int$specialfalse for the standard rows, 1 for the header rows, 2 for the footer rows
Renvoie
array Array of IDs
Depuis
1.7.3

◆ getTableOptions()

getTableOptions ( )

Get the Attributes of the current table

Renvoie
array Associative array of attributes
Depuis
1.7.3

Références $options.

◆ renderArea()

renderArea (   $ids,
  $area = 'tbody',
  $cell = 'td' 
)
protected

Render an area of the table

Paramètres
array$idsIDs of the rows to render
string$areaName of the area to render. Valid: tbody, tfoot, thead
string$cellName of the cell to render. Valid: td, th
Renvoie
string The rendered table area
Depuis
1.7.3

Références $id, $name, et $output.

◆ renderAttributes()

renderAttributes (   $attributes)
protected

Renders an HTML attribute from an associative array

Paramètres
array$attributesAssociative array of attributes
Renvoie
string The HTML attribute string
Depuis
1.7.3

Références $attributes, $key, $option, et $return.

◆ setActiveRow()

setActiveRow (   $id)

Set the currently active row

Paramètres
int$idID of the row to be set to current
Renvoie
JGrid This object for chaining
Depuis
1.7.3

Références $id.

◆ setColumns()

setColumns (   $columns)

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

Paramètres
array$columnsList of internal column names
Renvoie
JGrid This object for chaining
Depuis
1.7.3

Références $columns.

◆ setRowCell()

setRowCell (   $name,
  $content,
  $option = array(),
  $replace = true 
)

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

Paramètres
string$nameName of the column
string$contentContent for the cell
array$optionAssociative array of attributes for the td-element
bool$replaceIf false, the content is appended to the current content of the cell
Renvoie
JGrid This object for chaining
Depuis
1.7.3

Références $content, $name, et $option.

◆ setRowOptions()

setRowOptions (   $options)

Method to set the attributes of the currently active row

Paramètres
array$optionsAssociative array of attributes
Renvoie
JGrid This object for chaining
Depuis
1.7.3

Références $options.

◆ setTableOptions()

setTableOptions (   $options = array(),
  $replace = false 
)

Method to set the attributes for a table-tag

Paramètres
array$optionsAssociative array of attributes for the table-tag
bool$replaceReplace possibly existing attributes
Renvoie
JGrid This object for chaining
Depuis
1.7.3

Références $options.

◆ toString()

toString ( )

Render the HTML table

Renvoie
string The rendered HTML table
Depuis
1.7.3

Références $output.

Documentation des champs

◆ $activeRow

$activeRow = 0
protected

◆ $columns

$columns = array()
protected

◆ $options

$options
protected

◆ $rows

$rows = array()
protected

◆ $specialRows

$specialRows = array('header' => array(), 'footer' => array())
protected

La documentation de cette classe a été générée à partir du fichier suivant :