PHP Class Grido\Grid

Author: Petr Bugyík
Inheritance: extends Grido\Components\Container
Afficher le fichier Open project: o5/grido Class Usage Examples

Méthodes publiques

Свойство Type Description
$filter array @persistent
$onFetchData event for modifying data
$onRegistered event on all grid's components registered
$onRender event on render
$page integer @persistent
$perPage integer @persistent
$sort array @persistent

Protected Properties

Свойство Type Description
$count total count of items
$customization grido\Customization
$data mixed
$defaultFilter array
$defaultPerPage integer
$defaultSort array
$filterRenderType string
$model Grido\DataSources\IDataSource
$options array
$paginator Grido\Components\Paginator
$perPageList array
$primaryKey string
$propertyAccessor Symfony\Component\PropertyAccess\PropertyAccessor
$rememberState boolean
$rememberStateSectionName string
$rowCallback returns tr html element; function($row, Html $tr)
$strictMode boolean
$tablePrototype Nette\Utils\Html
$translator Nette\Localization\ITranslator

Méthodes publiques

Méthode Description
__getConditions ( array $filter ) : array
__triggerUserNotice ( string $message )
createTemplate ( ) : Nette\Templating\FileTemplate
getActualFilter ( string $key = NULL ) : mixed Returns actual filter values.
getClientSideOptions ( ) : array Returns client-side options.
getCount ( ) : integer Returns total count of data.
getCustomization ( ) : grido\Customization
getData ( boolean $applyPaging = TRUE, boolean $useCache = TRUE, boolean $fetch = TRUE ) : array | Grido\DataSources\IDataSource | Selection Returns fetched data.
getDefaultFilter ( ) : array Returns default filter.
getDefaultPerPage ( ) : integer Returns default per page.
getDefaultSort ( ) : array Returns default sort.
getFilterRenderType ( ) : string
getModel ( ) : Grido\DataSources\IDataSource
getPaginator ( ) : Grido\Components\Paginator
getPerPage ( ) : integer Returns items per page.
getPerPageList ( ) : array Returns list of possible items per page.
getPrimaryKey ( ) : string Returns primary key.
getProperty ( array | object $object, string $name ) : mixed A simple wrapper around symfony/property-access with Nette Database dot notation support.
getPropertyAccessor ( ) : PropertyAccessor
getRememberSession ( boolean $forceStart = FALSE ) : SessionSection | null Returns remember session for set expiration, etc.
getRememberState ( ) : boolean Returns remember state.
getRowCallback ( ) : callback Returns row callback.
getRowPrototype ( mixed $row ) : Nette\Utils\Html
getTablePrototype ( ) : Nette\Utils\Html Returns table html element of grid.
getTranslator ( ) : Grido\Translations\FileTranslator Returns translator.
handleFilter ( Nette\Forms\Controls\SubmitButton $button )
handlePage ( integer $page )
handlePerPage ( Nette\Forms\Controls\SubmitButton $button )
handleRefresh ( ) Ajax method.
handleReset ( Nette\Forms\Controls\SubmitButton $button )
handleSort ( array $sort )
isStrictMode ( ) : boolean
loadState ( array $params ) Loads state informations.
reload ( ) : void Refresh wrapper.
render ( )
saveState ( array &$params, Nette\Application\UI\PresenterComponentReflection $reflection = NULL ) Saves state informations for next request.
setClientSideOptions ( array $options ) : Grid Sets client-side options.
setCustomization ( grido\Customization $customization )
setDefaultFilter ( array $filter ) : Grid Sets default filtering.
setDefaultPerPage ( integer $perPage ) : Grid Sets the default number of items per page.
setDefaultSort ( array $sort ) : Grid Sets default sorting.
setFilterRenderType ( string $type ) : Grid Sets type of filter rendering.
setModel ( mixed $model, boolean $forceWrapper = FALSE ) : Grid Sets a model that implements the interface Grido\DataSources\IDataSource or data-source object.
setPaginator ( Grido\Components\Paginator $paginator ) : Grid Sets custom paginator.
setPerPageList ( array $perPageList ) : Grid Sets items to per-page select.
setPrimaryKey ( string $key ) : Grid Sets grid primary key.
setRememberState ( boolean $state = TRUE, string $sectionName = NULL ) : Grid Sets saving state to session.
setRowCallback ( $callback ) : Grid Sets callback for customizing tr html object.
setStrictMode ( boolean $mode ) : Grid Determines whether any user error will cause a notice.
setTemplateFile ( string $file ) : Grid Sets file name of custom template.
setTranslator ( Nette\Localization\ITranslator $translator ) : Grid Sets translator.

Méthodes protégées

Méthode Description
applyFiltering ( )
applyPaging ( )
applySorting ( )
createComponentForm ( $name )
getItemsForCountSelect ( ) : array
saveRememberState ( )

Method Details

__getConditions() public méthode

public __getConditions ( array $filter ) : array
$filter array
Résultat array

__triggerUserNotice() public méthode

public __triggerUserNotice ( string $message )
$message string

applyFiltering() protected méthode

protected applyFiltering ( )

applyPaging() protected méthode

protected applyPaging ( )

applySorting() protected méthode

protected applySorting ( )

createComponentForm() protected méthode

protected createComponentForm ( $name )

createTemplate() public méthode

public createTemplate ( ) : Nette\Templating\FileTemplate
Résultat Nette\Templating\FileTemplate

getActualFilter() public méthode

Returns actual filter values.
public getActualFilter ( string $key = NULL ) : mixed
$key string
Résultat mixed

getClientSideOptions() public méthode

Returns client-side options.
public getClientSideOptions ( ) : array
Résultat array

getCount() public méthode

Returns total count of data.
public getCount ( ) : integer
Résultat integer

getCustomization() public méthode

public getCustomization ( ) : grido\Customization
Résultat grido\Customization

getData() public méthode

Returns fetched data.
public getData ( boolean $applyPaging = TRUE, boolean $useCache = TRUE, boolean $fetch = TRUE ) : array | Grido\DataSources\IDataSource | Selection
$applyPaging boolean
$useCache boolean
$fetch boolean
Résultat array | Grido\DataSources\IDataSource | Nette\Database\Table\Selection

getDefaultFilter() public méthode

Returns default filter.
public getDefaultFilter ( ) : array
Résultat array

getDefaultPerPage() public méthode

Returns default per page.
public getDefaultPerPage ( ) : integer
Résultat integer

getDefaultSort() public méthode

Returns default sort.
public getDefaultSort ( ) : array
Résultat array

getFilterRenderType() public méthode

public getFilterRenderType ( ) : string
Résultat string

getItemsForCountSelect() protected méthode

protected getItemsForCountSelect ( ) : array
Résultat array

getModel() public méthode

public getModel ( ) : Grido\DataSources\IDataSource
Résultat Grido\DataSources\IDataSource

getPaginator() public méthode

public getPaginator ( ) : Grido\Components\Paginator
Résultat Grido\Components\Paginator

getPerPage() public méthode

Returns items per page.
public getPerPage ( ) : integer
Résultat integer

getPerPageList() public méthode

Returns list of possible items per page.
public getPerPageList ( ) : array
Résultat array

getPrimaryKey() public méthode

Returns primary key.
public getPrimaryKey ( ) : string
Résultat string

getProperty() public méthode

A simple wrapper around symfony/property-access with Nette Database dot notation support.
public getProperty ( array | object $object, string $name ) : mixed
$object array | object
$name string
Résultat mixed

getPropertyAccessor() public méthode

public getPropertyAccessor ( ) : PropertyAccessor
Résultat Symfony\Component\PropertyAccess\PropertyAccessor

getRememberSession() public méthode

Returns remember session for set expiration, etc.
public getRememberSession ( boolean $forceStart = FALSE ) : SessionSection | null
$forceStart boolean - if TRUE, session will be started if not
Résultat Nette\Http\SessionSection | null

getRememberState() public méthode

Returns remember state.
public getRememberState ( ) : boolean
Résultat boolean

getRowCallback() public méthode

Returns row callback.
public getRowCallback ( ) : callback
Résultat callback

getRowPrototype() public méthode

public getRowPrototype ( mixed $row ) : Nette\Utils\Html
$row mixed item from db
Résultat Nette\Utils\Html

getTablePrototype() public méthode

Returns table html element of grid.
public getTablePrototype ( ) : Nette\Utils\Html
Résultat Nette\Utils\Html

getTranslator() public méthode

Returns translator.
public getTranslator ( ) : Grido\Translations\FileTranslator
Résultat Grido\Translations\FileTranslator

handleFilter() public méthode

public handleFilter ( Nette\Forms\Controls\SubmitButton $button )
$button Nette\Forms\Controls\SubmitButton

handlePage() public méthode

public handlePage ( integer $page )
$page integer

handlePerPage() public méthode

public handlePerPage ( Nette\Forms\Controls\SubmitButton $button )
$button Nette\Forms\Controls\SubmitButton

handleRefresh() public méthode

Ajax method.
public handleRefresh ( )

handleReset() public méthode

public handleReset ( Nette\Forms\Controls\SubmitButton $button )
$button Nette\Forms\Controls\SubmitButton

handleSort() public méthode

public handleSort ( array $sort )
$sort array

isStrictMode() public méthode

public isStrictMode ( ) : boolean
Résultat boolean

loadState() public méthode

Loads state informations.
public loadState ( array $params )
$params array

reload() public méthode

Refresh wrapper.
public reload ( ) : void
Résultat void

render() public méthode

public render ( )

saveRememberState() protected méthode

protected saveRememberState ( )

saveState() public méthode

Saves state informations for next request.
public saveState ( array &$params, Nette\Application\UI\PresenterComponentReflection $reflection = NULL )
$params array
$reflection Nette\Application\UI\PresenterComponentReflection (internal, used by Presenter)

setClientSideOptions() public méthode

Sets client-side options.
public setClientSideOptions ( array $options ) : Grid
$options array
Résultat Grid

setCustomization() public méthode

public setCustomization ( grido\Customization $customization )
$customization grido\Customization

setDefaultFilter() public méthode

Sets default filtering.
public setDefaultFilter ( array $filter ) : Grid
$filter array
Résultat Grid

setDefaultPerPage() public méthode

Sets the default number of items per page.
public setDefaultPerPage ( integer $perPage ) : Grid
$perPage integer
Résultat Grid

setDefaultSort() public méthode

Sets default sorting.
public setDefaultSort ( array $sort ) : Grid
$sort array
Résultat Grid

setFilterRenderType() public méthode

Defaults inner (Filter::RENDER_INNER) if column does not exist then outer filter (Filter::RENDER_OUTER).
public setFilterRenderType ( string $type ) : Grid
$type string
Résultat Grid

setModel() public méthode

Sets a model that implements the interface Grido\DataSources\IDataSource or data-source object.
public setModel ( mixed $model, boolean $forceWrapper = FALSE ) : Grid
$model mixed
$forceWrapper boolean
Résultat Grid

setPaginator() public méthode

Sets custom paginator.
public setPaginator ( Grido\Components\Paginator $paginator ) : Grid
$paginator Grido\Components\Paginator
Résultat Grid

setPerPageList() public méthode

Sets items to per-page select.
public setPerPageList ( array $perPageList ) : Grid
$perPageList array
Résultat Grid

setPrimaryKey() public méthode

Defaults is "id".
public setPrimaryKey ( string $key ) : Grid
$key string
Résultat Grid

setRememberState() public méthode

Sets saving state to session.
public setRememberState ( boolean $state = TRUE, string $sectionName = NULL ) : Grid
$state boolean
$sectionName string
Résultat Grid

setRowCallback() public méthode

Callback returns tr html element; function($row, Html $tr).
public setRowCallback ( $callback ) : Grid
$callback
Résultat Grid

setStrictMode() public méthode

Determines whether any user error will cause a notice.
public setStrictMode ( boolean $mode ) : Grid
$mode boolean
Résultat Grid

setTemplateFile() public méthode

Sets file name of custom template.
public setTemplateFile ( string $file ) : Grid
$file string
Résultat Grid

setTranslator() public méthode

Sets translator.
public setTranslator ( Nette\Localization\ITranslator $translator ) : Grid
$translator Nette\Localization\ITranslator
Résultat Grid

Property Details

$count protected_oe property

total count of items
protected $count

$customization protected_oe property

protected Customization,grido $customization
Résultat grido\Customization

$data protected_oe property

protected mixed $data
Résultat mixed

$defaultFilter protected_oe property

protected array $defaultFilter
Résultat array

$defaultPerPage protected_oe property

protected int $defaultPerPage
Résultat integer

$defaultSort protected_oe property

protected array $defaultSort
Résultat array

$filter public_oe property

@persistent
public array $filter
Résultat array

$filterRenderType protected_oe property

protected string $filterRenderType
Résultat string

$model protected_oe property

protected IDataSource,Grido\DataSources $model
Résultat Grido\DataSources\IDataSource

$onFetchData public_oe property

event for modifying data
public $onFetchData

$onRegistered public_oe property

event on all grid's components registered
public $onRegistered

$onRender public_oe property

event on render
public $onRender

$options protected_oe property

protected array $options
Résultat array

$page public_oe property

@persistent
public int $page
Résultat integer

$paginator protected_oe property

protected Paginator,Grido\Components $paginator
Résultat Grido\Components\Paginator

$perPage public_oe property

@persistent
public int $perPage
Résultat integer

$perPageList protected_oe property

protected array $perPageList
Résultat array

$primaryKey protected_oe property

protected string $primaryKey
Résultat string

$propertyAccessor protected_oe property

protected PropertyAccessor,Symfony\Component\PropertyAccess $propertyAccessor
Résultat Symfony\Component\PropertyAccess\PropertyAccessor

$rememberState protected_oe property

protected bool $rememberState
Résultat boolean

$rememberStateSectionName protected_oe property

protected string $rememberStateSectionName
Résultat string

$rowCallback protected_oe property

returns tr html element; function($row, Html $tr)
protected $rowCallback

$sort public_oe property

@persistent
public array $sort
Résultat array

$strictMode protected_oe property

protected bool $strictMode
Résultat boolean

$tablePrototype protected_oe property

protected Html,Nette\Utils $tablePrototype
Résultat Nette\Utils\Html

$translator protected_oe property

protected ITranslator,Nette\Localization $translator
Résultat Nette\Localization\ITranslator