Class: Structures_DataGrid
Source Location: /Structures_DataGrid-0.9.3/Structures/DataGrid.php
Structures_DataGrid Class
Author(s):
|
|
|
Inherited Variables
|
Inherited Methods
|
Class Details
Class Variables
Method Detail
Structures_DataGrid (Constructor) [line 305]
void Structures_DataGrid(
[string
$limit = null], [int
$page = null], [string
$rendererType = null])
|
|
Constructor Builds the DataGrid class. The Core functionality and Renderer are seperated for maintainability and to keep cohesion high.
Parameters:
addColumn [line 1023]
mixed addColumn(
object
$column, [string
$position = 'last'], [string
$relativeTo = null])
|
|
Add a column, with optional position
Parameters:
attachRenderer [line 769]
mixed attachRenderer(
object
$renderer)
|
|
Attach an already instantiated Rendering driver
Parameters:
bind [line 1171]
bool bind(
mixed
$container, [array
$options = array()], [string
$type = null])
|
|
A simple way to add a record set to the datagrid
Parameters:
bindDataSource [line 1189]
mixed bindDataSource(
mixed
$source)
|
|
Bind an already instantiated DataSource driver
Parameters:
build [line 1549]
dataSourceFactory [line 437]
Datasource driver Factory A clever method which loads and instantiate data source drivers. Can be called in various ways: Detect the source type and load the appropriate driver with default options:
Detect the source type and load the appropriate driver with custom options:
Load a driver for an explicit type (faster, bypasses detection routine):
Parameters:
dump [line 335]
Method used for debugging purposes only. Displays a dump of the DataGrid object.
enableStreaming [line 1717]
void enableStreaming(
[integer
$bufferSize = 500])
|
|
Enable streaming support for reading from DataSources and writing with Renderers and set the buffer size (number of records)
Parameters:
fill [line 809]
mixed fill(
object
$container, [array
$options = array()], [string
$type = null])
|
|
Fill a rendering container with data
Parameters:
generateColumns [line 1738]
void generateColumns(
[array
$fields = array()])
|
|
Generate columns from a fields list This is a shortcut for adding simple columns easily, instead of creating them manually and calling addColumn() for each. The generated columns are appended to the current column set.
Parameters:
getColumnByField [line 1124]
object Either getColumnByField(
string
$fieldName)
|
|
Find a column by field name
Parameters:
getColumnByName [line 1104]
object Either getColumnByName(
string
$name)
|
|
Find a column by name (label)
Parameters:
getColumnCount [line 922]
Returns the number of columns
getColumns [line 1080]
Return the current columns
getCurrentPage [line 882]
Retrieves the current page number when paging is implemented
getCurrentRecordNumberEnd [line 969]
int getCurrentRecordNumberEnd(
)
|
|
Returns the number of the last record of the current page
getCurrentRecordNumberStart [line 952]
int getCurrentRecordNumberStart(
)
|
|
Returns the number of the first record of the current page
getDataSource [line 646]
object DataSource getDataSource(
)
|
|
Get the currently loaded DataSource driver Retrieves the DataSource object as a reference
getOutput [line 579]
mixed getOutput(
[int
$type = null], [array
$options = array()])
|
|
Return the datagrid output
Parameters:
getPageCount [line 907]
Returns the total number of pages
getRecordCount [line 933]
Returns the total number of records
getRenderer [line 632]
object Renderer getRenderer(
)
|
|
Get the current or default Rendering driver Retrieves the renderer object as a reference
removeColumn [line 1145]
void removeColumn(
object
$column)
|
|
Remove a column
Parameters:
render [line 517]
mixed render(
[mixed
$renderer = null], [array
$options = array()])
|
|
Render the datagrid You can call this method several times with different renderers.
Parameters:
setCurrentPage [line 895]
void setCurrentPage(
mixed
$page)
|
|
Define the current page number. This method is used when paging is implemented
Parameters:
setDataSourceOption [line 1689]
void setDataSourceOption(
string
$name, mixed
$value)
|
|
Set a single datasource option
Parameters:
setDataSourceOptions [line 1701]
void setDataSourceOptions(
array
$options)
|
|
Set multiple datasource options
Parameters:
setDefaultSort [line 1328]
mixed setDefaultSort(
array
$sortSpec)
|
|
Set default sorting specification If there is no sorting query in the HTTP request, and if the sortRecordSet() method is not called, then the specification passed to setDefaultSort() will be used. This is especially useful if you want the data to already be sorted when a user first see the datagrid. This method needs to be called before bind().
Parameters:
setRenderer [line 667]
mixed setRenderer(
string
$type, [array
$options = array()])
|
|
Set Renderer Defines which renderer to be used by the DataGrid based on given $type and $options. To attach an existing renderer instance, use attachRenderer() instead.
Parameters:
setRendererOption [line 1652]
void setRendererOption(
string
$name, mixed
$value, [bool
$common = false])
|
|
Set a single renderer option
Parameters:
setRendererOptions [line 1667]
void setRendererOptions(
array
$options, [bool
$common = false])
|
|
Set multiple renderer options
Parameters:
setRequestPrefix [line 991]
void setRequestPrefix(
string
$prefix)
|
|
Set the global GET/POST variables prefix If you need to change the request variables, you can define a prefix. This is extra useful when using multiple datagrids. This method needs to be called before bind().
Parameters:
setUrlFormat [line 1786]
void setUrlFormat(
mixed
$format, [string
$prefix = null], [string
$scriptname = null])
|
|
Enable and configure URL mapping If this is set, it will be parsed instead of GET/POST. This is only supported on PHP5, as it depends on Net_URL_Mapper. There are three possible placeholders, :pager, :orderBy and :direction. :page or (:orderBy and :direction) can be used alone. It is possible to use multipe DataGrid instances on one page with different prefixes. Instead of a format string you might also pass a Net_URL_Mapper instance to this method, in which case $prefix and $scriptname will be ignored. This instance must be properly set up, connected to url patterns, etc... This is especially useful when you've already configured URL mapping globally for your application and want Structures_DataGrid to integrate.
Parameters:
sortRecordSet [line 1298]
void sortRecordSet(
array
$sortSpec, [string
$direction = 'ASC'])
|
|
Sorts the records by the defined field. Do not use this method if data is coming from a database as sorting is much faster coming directly from the database itself.
Parameters:
Documentation generated on Mon, 11 Mar 2019 15:47:20 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.
|
|