UNA
|
Public Member Functions | |
getObject () | |
addMarkers ($a) | |
setBrowseParams ($aBrowseParams) | |
setActionCsrfChecking ($bCsrfChecking) | |
isActionCsrfCheckingDisabled () | |
Static Public Member Functions | |
static | getObjectInstance ($sObject, $oTemplate=false) |
![]() | |
static | getObjectInstance ($sObject) |
Protected Member Functions | |
__construct ($aOptions) | |
_replaceMarkers () | |
_getData ($sFilter, $sOrderField, $sOrderDir, $iStart, $iPerPage) | |
_getDataArray ($sFilter, $sOrderField, $sOrderDir, $iStart, $iPerPage) | |
_getDataSql ($sFilter, $sOrderField, $sOrderDir, $iStart, $iPerPage) | |
_getDataSqlCounter ($sQuery, $sFilter) | |
_modifyDataSqlWhereClause ($sQuery, $sFilter, &$sOrderByFilter) | |
_getDataSqlWhereClause ($sFilter, &$sOrderByFilter) | |
_getDataSqlOrderClause ($sOrderByFilter, $sOrderField, $sOrderDir, $bFieldsOnly=false) | |
_getCellData ($sKey, $aField, $aRow) | |
_cmp ($r1, $r2) | |
_genMethodName ($s) | |
_isVisibleGrid ($a) | |
_getFilterValue () | |
_getOrderFields ($bTranslatable=false) | |
_getOrderFieldsTranslatable () | |
_getOrderValue () | |
Protected Attributes | |
$_bIsApi | |
$_aMarkers = array () | |
$_sObject | |
$_aOptions | |
$_aBrowseParams | |
$_sDefaultSortingOrder = 'ASC' | |
$_iTotalCount = 0 | |
$_bActionCsrfChecking | |
Grid for any content.
It allows to display some data as grid with ready to use features:
The advantages of the this system:
Grid is working together with Paginate to look through the data in the grid.
There are some fields which are always available, additionally to the provided set of fields:
Usually you need to handle actions manually, but there are several actions which are available by default:
Cell is displayed with default design. It is possible to easily customize its design by specifying custom attributes as 'attr_cell' in params field in sys_grid_fields table.
If it is not enough, you can customize it even more by adding the method to your custom class with the following format: _getCell[field name] where [field name] is the name of the field you want to have custom look with the capital first letter.
For example:
Above example is displaying user's status using different colors depending on the status value. Please note that you need to convert attributes by adding some default classes or styles if you need.
This is working similar to displaying custom cell. It easily customize its design by specifying custom attributes as 'attr_head' in params field in sys_grid_fields table. If it is not enough, you can customize it even more by adding the method to your custom class with the following format: _getCellHeader[field name] where [field name] is the name of the field you want to have custom look with the capital first letter.
For example:
The above example replaces column header text with the image.
All actions are displayed as buttons. Bulk and independent actions are displaed as big buttons and single actions are displayed as small buttons.
It is possible to completely customize it by adding the following method to your custom class: _getAction[action name] where [action name] is the action name with the capital first letter.
For example:
The above example disables default onclick event and just displays an alert. Please note that you need to convert attributes by adding some default classes or styles if you need.
As it was mentioned earlier only several actions can be handled automatically, all other actions must be processed manually. To add action handler you need to add method to your custom class with the following format: performAction[action name] where [action name] is the action name with the capital first letter.
For example:
The action can be used as 'single' or 'bulk', in the case of 'single' action 'ids' array always has one element.
As the result, action must outputs JSON array, which is done by echoJson function. The defined indexes in the array determines behavior after action is performed, the following behaviors are supported:
|
protected |
Constructor
$aOptions | array of grid options |
Reimplemented in BxTemplAuditGrid, BxTemplReportsGrid, and BxTemplStudioBadgesGrid.
|
protected |
grid
get_data
object
- [string] grid object nameoptions
- [array] grid options array as key&value pairsmarkers
- [array] markers array as key&value pairsfilter
- [string] filter valuebrowse_params
- [array] additional browse params array as key&value pairsresults
- [array] by ref, array of grid rows, where each row is an array of fields values, can be overridden in hook processing
|
protected |
grid
get_data_by_filter
object
- [string] grid object nameoptions
- [array] grid options array as key&value pairsmarkers
- [array] markers array as key&value pairsfilter
- [string] filter valuebrowse_params
- [array] additional browse params array as key&value pairsconditions
- [string] by ref, 'where' part of SQL query in accordance with provided filter(s), can be overridden in hook processing
|
protected |
grid
get_data_by_filter
object
- [string] grid object nameoptions
- [array] grid options array as key&value pairsmarkers
- [array] markers array as key&value pairsfilter
- [string] filter valuebrowse_params
- [array] additional browse params array as key&value pairsconditions
- [string] by ref, 'where' part of SQL query in accordance with provided filter(s), can be overridden in hook processing
|
protected |
Replace provided markers in form array
$a | form description array |
BxDolGrid::addMarkers | ( | $a | ) |
Add replace markers. Curently markers are replaced in 'source' field
$a | array of markers as key => value |
Implements iBxDolReplaceable.
|
static |
Get grid object instance by object name
$sObject | object name |