Constructor for a JGrid object
JGrid
__construct
([array $options = array()])
-
array
$options: Associative array of attributes for the table-tag
Add new column name to process
JGrid
addColumn
(
string $name)
-
string
$name: Internal column name
Adds a row to the table and sets the currently active row to the new row
JGrid
addRow
([
array $options =
array()], [
int $special =
false])
-
array
$options: Associative array of attributes for the row
-
int
$special:
- for a new row in the header, 2 for a new row in the footer
Delete column by name
JGrid
deleteColumn
(
string $name)
-
string
$name: Name of the column to be deleted
Delete a row from the object
JGrid
deleteRow
(
int $id)
-
int
$id: ID of the row to be deleted
Get the currently active row ID
int
getActiveRow
()
Returns the list of internal columns
array
getColumns
()
Get all data for a row
array
getRow
([int $id = false])
-
int
$id: ID of the row to return
Method to get the attributes of the currently active row
array
getRowOptions
()
Get the IDs of all rows in the table
array
getRows
([int $special = false])
-
int
$special: false for the standard rows, 1 for the header rows, 2 for the footer rows
Get the Attributes of the current table
array
getTableOptions
()
Render an area of the table
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
Renders an HTML attribute from an associative array
string
renderAttributes
(array $attributes)
-
array
$attributes: Associative array of attributes
Set the currently active row
JGrid
setActiveRow
(
int $id)
-
int
$id: ID of the row to be set to current
Method to set a whole range of columns at once This can be used to re-order the columns, too
JGrid
setColumns
(
array $columns)
-
array
$columns: List of internal column names
Set cell content for a specific column for the currently active row
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
Method to set the attributes of the currently active row
JGrid
setRowOptions
(
array $options)
-
array
$options: Associative array of attributes
Method to set the attributes for a table-tag
JGrid
setTableOptions
([
array $options =
array()], [
bool $replace =
false])
-
array
$options: Associative array of attributes for the table-tag
-
bool
$replace: Replace possibly existing attributes
Render the HTML table
string
toString
()
Magic function to render this object as a table.
string
__toString
()