PHP Class Ublaboo\DataGrid\DataGrid

Inheritance: extends Nette\Application\UI\Control
Afficher le fichier Open project: ublaboo/datagrid Class Usage Examples

Méthodes publiques

Свойство Type Description
$default_filter array
$default_filter_use_on_reset boolean
$default_sort array
$default_sort_use_on_reset boolean
$filter array
$form_method string Default form method
$icon_prefix string
$onColumnAdd callable[]
$onExport callable[]
$onFiltersAssabled callable[]
$onRedraw callable[]
$onRender callable[]
$page integer
$per_page integer | string
$sort array
$strict_entity_property boolean When set to TRUE, datagrid throws an exception when tring to get related entity within join and entity does not exist
$strict_session_filter_values boolean When set to TRUE, datagrid throws an exception when tring to set filter value, that does not exist (select, multiselect, etc)

Protected Properties

Свойство Type Description
$actions Ublaboo\DataGrid\Column\Action[]
$auto_submit boolean
$can_hide_columns boolean
$collapsible_outer_filters boolean
$column_callbacks array
$columns Column\IColumn[]
$columnsSummary ColumnsSummary
$columns_export_order array
$columns_visibility array
$csv_export boolean
$csv_export_filtered boolean
$dataFilter DataFilter
$dataModel DataModel
$default_per_page integer
$do_paginate boolean
$exports Ublaboo\DataGrid\Export\Export[]
$filter_submit_button Ublaboo\DataGrid\Filter\SubmitButton | null
$filters Ublaboo\DataGrid\Filter\Filter[]
$force_filter_active boolean
$grid_session Nette\Http\SessionSection
$group_action_collection Ublaboo\DataGrid\GroupAction\GroupActionCollection
$has_column_reset boolean
$inlineAdd Ublaboo\DataGrid\InlineEdit\InlineEdit
$inlineEdit Ublaboo\DataGrid\InlineEdit\InlineEdit
$items_detail Ublaboo\DataGrid\Column\ItemDetail
$items_per_page_list array
$multiSort boolean
$original_template string
$outer_filter_rendering boolean
$primary_key string
$redraw_item array
$refresh_url boolean
$remember_state boolean
$rowCallback callable
$row_conditions array
$snippets_set boolean
$some_column_default_hide boolean
$sort_callback callable | null
$sortable boolean
$sortable_handler string
$template_file string
$toolbar_buttons Ublaboo\DataGrid\Toolbar\ToolbarButton[]
$translator mixed
$tree_view_children_callback callable
$tree_view_has_children_callback callable
$tree_view_has_children_column string
$use_happy_components boolean

Méthodes publiques

Méthode Description
__construct ( Nette\ComponentModel\IContainer $parent = NULL, string $name = NULL )
addAction ( string $key, string $name, string $href = NULL, array $params = NULL ) : Action Create action
addActionCallback ( string $key, string $name, $callback = NULL ) : Action Create action callback
addColumnCallback ( string $key, callable $callback ) : void
addColumnDateTime ( string $key, string $name, string | null $column = NULL ) : ColumnDateTime Add column with date formating
addColumnLink ( string $key, string $name, $href = NULL, string | null $column = NULL, array $params = NULL ) : ColumnLink Add column with link
addColumnNumber ( string $key, string $name, string | null $column = NULL ) : ColumnNumber Add column with possible number formating
addColumnStatus ( string $key, string $name, string | null $column = NULL ) : ColumnStatus Add column status
addColumnText ( string $key, string $name, string | null $column = NULL ) : Column\ColumnText Add text column with no other formating
addExportCallback ( string $text, callable $callback, boolean $filtered = FALSE ) : Export Add export of type callback
addExportCsv ( string $text, string $csv_file_name, string | null $output_encoding = NULL, string | null $delimiter = NULL, boolean $include_bom = FALSE ) : Export Add already implemented csv export
addExportCsvFiltered ( string $text, string $csv_file_name, string | null $output_encoding = NULL, string | null $delimiter = NULL, boolean $include_bom = FALSE ) : Export Add already implemented csv export, but for filtered data
addFilterDate ( string $key, string $name, string $column = NULL ) : FilterDate Add datepicker filter
addFilterDateRange ( string $key, string $name, string $column = NULL, $name_second = '-' ) : FilterDateRange Add datepicker filter (from - to)
addFilterMultiSelect ( string $key, string $name, array $options, string $column = NULL ) : FilterSelect Add multi select box filter
addFilterRange ( string $key, string $name, string $column = NULL, $name_second = '-' ) : FilterRange Add range filter (from - to)
addFilterSelect ( string $key, string $name, array $options, string $column = NULL ) : FilterSelect Add select box filter
addFilterText ( string $key, string $name, array | string $columns = NULL ) : FilterText Add filter fot text search
addGroupAction ( string $title, array $options = [] ) : GroupAction Alias for add group select action
addGroupSelectAction ( string $title, array $options = [] ) : GroupAction Add group action (select box)
addGroupTextAction ( string $title ) : GroupAction Add group action (text input)
addGroupTextareaAction ( string $title ) : GroupAction Add group action (textarea)
addInlineAdd ( ) : InlineEdit
addInlineEdit ( $primary_where_column = NULL ) : InlineEdit
addMultiAction ( string $key, $name )
addToolbarButton ( string $href, string $text = '', array $params = [] ) : ToolbarButton Add toolbar button
allowRowsAction ( string $key, callable $condition ) : void
allowRowsGroupAction ( callable $condition ) : void
allowRowsInlineEdit ( callable $condition ) : void
assableFilters ( ) : Filter[] Fill array of Filter\Filter[] with values from $this->filter persistent parameter Fill array of Column\Column[] with values from $this->sort persistent parameter
attached ( $presenter ) : void {inheritDoc}
canHideColumns ( ) : boolean Can datagrid hide colums?
createComponentFilter ( ) : Nette\Application\UI\Form FilterAndGroupAction form factory
createComponentPaginator ( ) : DataGridPaginator Paginator factory
deleteSessionData ( $key ) : void Delete session data
deleteSesssionData ( $key ) : void Delete session data
filterSucceeded ( Nette\Application\UI\Form $form ) : void Set $this->filter values after filter form submitted
findDefaultFilter ( ) : void User may set default filter, find it
findDefaultPerPage ( ) : void User may set default "items per page" value, apply it
findDefaultSort ( ) : void User may set default sorting, apply it
findSessionValues ( ) : void Try to restore session stuff
getAction ( string $key ) : Action Get existing action
getColumn ( string $key ) : Column Return existing column
getColumnCallback ( string $key ) : callable | null
getColumns ( ) : Column\IColumn[] Get set of set columns
getColumnsCount ( ) : integer Get count of columns
getColumnsSummary ( ) : ColumnsSummary | null
getColumnsVisibility ( )
getDataSource ( ) : Ublaboo\DataGrid\DataSource\IDataSource | null
getFilter ( string $key ) : Filter Get defined filter
getFilterSubmitButton ( ) : SubmitButton Submit button when no auto-submitting is used
getGroupActionCollection ( ) : GroupActionCollection Get collection of all group actions
getInlineAdd ( ) : InlineEdit | null
getInlineEdit ( ) : InlineEdit | null
getItemDetailForm ( ) : Container | null
getItemsDetail ( ) : array Get items detail parameters
getItemsPerPageList ( ) : array Get associative array of items_per_page_list
getOriginalTemplateFile ( ) : string Get DataGrid original template file
getPaginator ( ) : null | DataGridPaginator Return current paginator class
getParent ( ) : Nette\Application\UI\PresenterComponent
getPerPage ( ) : integer Get parameter per_page
getPrimaryKey ( ) : string Get primary key of datagrid data source
getRowCondition ( string $name, string | null $key = NULL ) : boolean | callable
getSessionData ( string $key = NULL, $default_value = NULL ) : mixed Get session data if functionality is enabled
getSessionSectionName ( ) : string Find some unique session key name
getSortNext ( Column $column ) : array
getSortableHandler ( ) : string Return sortable handle name
getSortableParentPath ( ) : strign
getTemplateFile ( ) : static Get DataGrid template file
getTranslator ( ) : Nette\Localization\ITranslator Get translator for datagrid
handleActionCallback ( $__key, $__id )
handleChangeStatus ( string $id, string $key, string $value ) : void Handler for column status
handleEdit ( mixed $id, mixed $key ) : void Handler for inline editing
handleExport ( integer $id ) : void Handler for export
handleGetChildren ( integer $parent ) : void Handler for getting children of parent item (e.g. category)
handleGetItemDetail ( mixed $id ) : void Handler for getting item detail
handleHideColumn ( string $column ) : void Notice datagrid to not display particular columns
handleInlineEdit ( mixed $id ) : void
handlePage ( integer $page ) : void Handler for changind page (just refresh site with page as persistent paramter set)
handleRefreshState ( ) : void Simply refresh url
handleResetColumnFilter ( string $key ) : void
handleResetFilter ( ) : void Handler for reseting the filter
handleShowAllColumns ( ) : void Tell datagrid to display all columns
handleShowColumn ( string $column ) : void Reveal particular column
handleShowDefaultColumns ( ) : void Tell datagrid to display default columns
handleSort ( array $sort ) : void Handler for sorting
hasAutoSubmit ( ) : boolean
hasCollapsibleOuterFilters ( ) : boolean
hasColumnReset ( ) : boolean
hasColumnsSummary ( ) : boolean Will datagrid show summary in the end?
hasGroupActions ( ) : boolean Has datagrid some group actions?
hasOuterFilterRendering ( ) : boolean Are datagrid filters rendered separately?
hasSomeColumnDefaultHide ( ) Are some of columns hidden bydefault?
hasTreeViewChildrenCallback ( ) : boolean Is tree view children callback set?
isFilterActive ( ) : boolean Is filter active?
isMultiSortEnabled ( ) : boolean Tell wether DataGrid can be sorted by multiple columns
isPaginated ( ) : boolean Tell whether Grid is paginated
isSortable ( ) : boolean Tell whether DataGrid is sortable
isTreeView ( ) : boolean Is tree view set?
redrawItem ( integer $id, mixed $primary_where_column = NULL ) : void Redraw just one row via ajax
reload ( $snippets = [] ) : void Redraw $this
removeAction ( string $key ) : void Remove action
removeColumn ( string $key ) : void Remove column
removeFilter ( string $key ) : void Remove filter
render ( ) : void Render template
resetExportsLinks ( )
saveSessionData ( string $key, mixed $value ) : void Save session data - just if it is enabled
sendNonEmptyFiltersInPayload ( Filter[] $filters ) : void
setAutoSubmit ( boolean $auto = TRUE ) Tell grid filters to by submitted automatically
setCollapsibleOuterFilters ( boolean $collapsible_outer_filters = TRUE )
setColumnReset ( boolean $reset = TRUE ) : static
setColumnsExportOrder ( array $order ) Columns order may be different for export and normal grid
setColumnsHideable ( ) : static Order Grid to set columns hideable.
setColumnsOrder ( array $order ) : static Set order of datagrid columns
setColumnsSummary ( array $columns, callable $rowCallback = NULL ) : ColumnsSummary Set columns to be summarized in the end.
setDataSource ( Ublaboo\DataGrid\DataSource\IDataSource | array | DibiFluent | Selection | Doctrine\ORM\QueryBuilder $source ) : static Set Grid data source
setDefaultFilter ( array $default_filter, boolean $use_on_reset = TRUE ) : static If we want to sent some initial filter
setDefaultPerPage ( $count ) : static Set default "items per page" value in pagination select
setDefaultSort ( array $sort ) : static Set default sorting
setDefaultSort ( array $sort, boolean $use_on_reset = TRUE ) : static Set default sorting
setFilter ( array $filter ) : static Set filter values (force - overwrite user data)
setFilterActive ( ) Tell that filter is active from whatever reasons return static
setFilterContainerDefaults ( Container $container, array $values )
setFilterContainerDefaults ( Container $container, array | Iterator $values ) : void
setItemsDetail ( mixed $detail = TRUE, boolean | null $primary_where_column = NULL ) : ItemDetail Items can have thair detail - toggled
setItemsDetailForm ( callable $callable_set_container ) : static
setItemsPerPageList ( array $items_per_page_list, $include_all = TRUE ) : static Set options of select "items_per_page"
setMultiSortEnabled ( boolean $multiSort = TRUE ) : void Enable multi-sorting capability
setOuterFilterRendering ( boolean $out = TRUE ) : static Should be datagrid filters rendered separately?
setPagination ( boolean $do ) : static Order Grid to "be paginated"
setPrimaryKey ( string $primary_key ) : static By default ID, you can change that
setRefreshUrl ( boolean $refresh = TRUE ) : static Should datagrid refresh url using history API?
setRememberState ( boolean $remember = TRUE ) : static Should datagrid remember its filters/pagination/etc using session?
setRowCallback ( callable $callback ) : static Each row can be modified with user callback
setSomeColumnDefaultHide ( boolean $default_hide ) Some of datagrid columns is hidden by default
setSortable ( boolean $sortable = TRUE ) : static Set grido to be sortable
setSortableHandler ( string $handler = 'sort!' ) : static Set sortable handle
setStrictSessionFilterValues ( boolean $strict = TRUE )
setTemplateFile ( string $template_file ) : static Set custom template file to render
setTranslator ( Nette\Localization\ITranslator $translator ) : static Set datagrid translator
setTreeView ( callable $get_children_callback, string | callable $tree_view_has_children_column = 'has_children' ) : static Setting tree view
treeViewChildrenCallback ( mixed $item ) : boolean
useHappyComponents ( boolean | null $use = NULL ) : void | boolean Tell datagrid wheteher to use or not happy components

Méthodes protégées

Méthode Description
addActionCheck ( string $key ) Check whether given key already exists in $this->filters
addColumn ( string $key, Column $column ) : Column
addColumnCheck ( string $key ) Check whether given key already exists in $this->columns
addFilterCheck ( string $key ) Check whether given key already exists in $this->filters
addToExports ( Export $export ) : Export Add export to array
createSorting ( array $sort, callable $sort_callback = NULL ) : void
createSorting ( array $sort, callable | null $sort_callback ) : void

Method Details

__construct() public méthode

public __construct ( Nette\ComponentModel\IContainer $parent = NULL, string $name = NULL )
$parent Nette\ComponentModel\IContainer
$name string

addAction() public méthode

Create action
public addAction ( string $key, string $name, string $href = NULL, array $params = NULL ) : Action
$key string
$name string
$href string
$params array
Résultat Ublaboo\DataGrid\Column\Action

addActionCallback() public méthode

Create action callback
public addActionCallback ( string $key, string $name, $callback = NULL ) : Action
$key string
$name string
Résultat Ublaboo\DataGrid\Column\Action

addActionCheck() protected méthode

Check whether given key already exists in $this->filters
protected addActionCheck ( string $key )
$key string

addColumn() protected méthode

protected addColumn ( string $key, Column $column ) : Column
$key string
$column Ublaboo\DataGrid\Column\Column
Résultat Ublaboo\DataGrid\Column\Column

addColumnCallback() public méthode

public addColumnCallback ( string $key, callable $callback ) : void
$key string
$callback callable
Résultat void

addColumnCheck() protected méthode

Check whether given key already exists in $this->columns
protected addColumnCheck ( string $key )
$key string

addColumnDateTime() public méthode

Add column with date formating
public addColumnDateTime ( string $key, string $name, string | null $column = NULL ) : ColumnDateTime
$key string
$name string
$column string | null
Résultat Ublaboo\DataGrid\Column\ColumnDateTime

addColumnNumber() public méthode

Add column with possible number formating
public addColumnNumber ( string $key, string $name, string | null $column = NULL ) : ColumnNumber
$key string
$name string
$column string | null
Résultat Ublaboo\DataGrid\Column\ColumnNumber

addColumnStatus() public méthode

Add column status
public addColumnStatus ( string $key, string $name, string | null $column = NULL ) : ColumnStatus
$key string
$name string
$column string | null
Résultat Ublaboo\DataGrid\Column\ColumnStatus

addColumnText() public méthode

Add text column with no other formating
public addColumnText ( string $key, string $name, string | null $column = NULL ) : Column\ColumnText
$key string
$name string
$column string | null
Résultat Column\ColumnText

addExportCallback() public méthode

Add export of type callback
public addExportCallback ( string $text, callable $callback, boolean $filtered = FALSE ) : Export
$text string
$callback callable
$filtered boolean
Résultat Ublaboo\DataGrid\Export\Export

addExportCsv() public méthode

Add already implemented csv export
public addExportCsv ( string $text, string $csv_file_name, string | null $output_encoding = NULL, string | null $delimiter = NULL, boolean $include_bom = FALSE ) : Export
$text string
$csv_file_name string
$output_encoding string | null
$delimiter string | null
$include_bom boolean
Résultat Ublaboo\DataGrid\Export\Export

addExportCsvFiltered() public méthode

Add already implemented csv export, but for filtered data
public addExportCsvFiltered ( string $text, string $csv_file_name, string | null $output_encoding = NULL, string | null $delimiter = NULL, boolean $include_bom = FALSE ) : Export
$text string
$csv_file_name string
$output_encoding string | null
$delimiter string | null
$include_bom boolean
Résultat Ublaboo\DataGrid\Export\Export

addFilterCheck() protected méthode

Check whether given key already exists in $this->filters
protected addFilterCheck ( string $key )
$key string

addFilterDate() public méthode

Add datepicker filter
public addFilterDate ( string $key, string $name, string $column = NULL ) : FilterDate
$key string
$name string
$column string
Résultat Ublaboo\DataGrid\Filter\FilterDate

addFilterDateRange() public méthode

Add datepicker filter (from - to)
public addFilterDateRange ( string $key, string $name, string $column = NULL, $name_second = '-' ) : FilterDateRange
$key string
$name string
$column string
Résultat Ublaboo\DataGrid\Filter\FilterDateRange

addFilterMultiSelect() public méthode

Add multi select box filter
public addFilterMultiSelect ( string $key, string $name, array $options, string $column = NULL ) : FilterSelect
$key string
$name string
$options array
$column string
Résultat Ublaboo\DataGrid\Filter\FilterSelect

addFilterRange() public méthode

Add range filter (from - to)
public addFilterRange ( string $key, string $name, string $column = NULL, $name_second = '-' ) : FilterRange
$key string
$name string
$column string
Résultat Ublaboo\DataGrid\Filter\FilterRange

addFilterSelect() public méthode

Add select box filter
public addFilterSelect ( string $key, string $name, array $options, string $column = NULL ) : FilterSelect
$key string
$name string
$options array
$column string
Résultat Ublaboo\DataGrid\Filter\FilterSelect

addFilterText() public méthode

Add filter fot text search
public addFilterText ( string $key, string $name, array | string $columns = NULL ) : FilterText
$key string
$name string
$columns array | string
Résultat Ublaboo\DataGrid\Filter\FilterText

addGroupAction() public méthode

Alias for add group select action
public addGroupAction ( string $title, array $options = [] ) : GroupAction
$title string
$options array
Résultat Ublaboo\DataGrid\GroupAction\GroupAction

addGroupSelectAction() public méthode

Add group action (select box)
public addGroupSelectAction ( string $title, array $options = [] ) : GroupAction
$title string
$options array
Résultat Ublaboo\DataGrid\GroupAction\GroupAction

addGroupTextAction() public méthode

Add group action (text input)
public addGroupTextAction ( string $title ) : GroupAction
$title string
Résultat Ublaboo\DataGrid\GroupAction\GroupAction

addGroupTextareaAction() public méthode

Add group action (textarea)
public addGroupTextareaAction ( string $title ) : GroupAction
$title string
Résultat Ublaboo\DataGrid\GroupAction\GroupAction

addInlineAdd() public méthode

public addInlineAdd ( ) : InlineEdit
Résultat Ublaboo\DataGrid\InlineEdit\InlineEdit

addInlineEdit() public méthode

public addInlineEdit ( $primary_where_column = NULL ) : InlineEdit
Résultat Ublaboo\DataGrid\InlineEdit\InlineEdit

addMultiAction() public méthode

public addMultiAction ( string $key, $name )
$key string

addToExports() protected méthode

Add export to array
protected addToExports ( Export $export ) : Export
$export Ublaboo\DataGrid\Export\Export
Résultat Ublaboo\DataGrid\Export\Export

addToolbarButton() public méthode

Add toolbar button
public addToolbarButton ( string $href, string $text = '', array $params = [] ) : ToolbarButton
$href string
$text string
$params array
Résultat Ublaboo\DataGrid\Toolbar\ToolbarButton

allowRowsAction() public méthode

public allowRowsAction ( string $key, callable $condition ) : void
$key string
$condition callable
Résultat void

allowRowsGroupAction() public méthode

public allowRowsGroupAction ( callable $condition ) : void
$condition callable
Résultat void

allowRowsInlineEdit() public méthode

public allowRowsInlineEdit ( callable $condition ) : void
$condition callable
Résultat void

assableFilters() public méthode

Fill array of Filter\Filter[] with values from $this->filter persistent parameter Fill array of Column\Column[] with values from $this->sort persistent parameter
public assableFilters ( ) : Filter[]
Résultat Ublaboo\DataGrid\Filter\Filter[] $this->filters === Filter\Filter[]

attached() public méthode

{inheritDoc}
public attached ( $presenter ) : void
Résultat void

canHideColumns() public méthode

Can datagrid hide colums?
public canHideColumns ( ) : boolean
Résultat boolean

createComponentFilter() public méthode

FilterAndGroupAction form factory
public createComponentFilter ( ) : Nette\Application\UI\Form
Résultat Nette\Application\UI\Form

createComponentPaginator() public méthode

Paginator factory
public createComponentPaginator ( ) : DataGridPaginator
Résultat Ublaboo\DataGrid\Components\DataGridPaginator\DataGridPaginator

createSorting() protected méthode

protected createSorting ( array $sort, callable $sort_callback = NULL ) : void
$sort array
$sort_callback callable
Résultat void

createSorting() protected méthode

protected createSorting ( array $sort, callable | null $sort_callback ) : void
$sort array
$sort_callback callable | null
Résultat void

deleteSessionData() public méthode

Delete session data
public deleteSessionData ( $key ) : void
Résultat void

deleteSesssionData() public méthode

Delete session data
Deprecation:
public deleteSesssionData ( $key ) : void
Résultat void

filterSucceeded() public méthode

Set $this->filter values after filter form submitted
public filterSucceeded ( Nette\Application\UI\Form $form ) : void
$form Nette\Application\UI\Form
Résultat void

findDefaultFilter() public méthode

User may set default filter, find it
public findDefaultFilter ( ) : void
Résultat void

findDefaultPerPage() public méthode

User may set default "items per page" value, apply it
public findDefaultPerPage ( ) : void
Résultat void

findDefaultSort() public méthode

User may set default sorting, apply it
public findDefaultSort ( ) : void
Résultat void

findSessionValues() public méthode

Try to restore session stuff
public findSessionValues ( ) : void
Résultat void

getAction() public méthode

Get existing action
public getAction ( string $key ) : Action
$key string
Résultat Ublaboo\DataGrid\Column\Action

getColumn() public méthode

Return existing column
public getColumn ( string $key ) : Column
$key string
Résultat Ublaboo\DataGrid\Column\Column

getColumnCallback() public méthode

public getColumnCallback ( string $key ) : callable | null
$key string
Résultat callable | null

getColumns() public méthode

Get set of set columns
public getColumns ( ) : Column\IColumn[]
Résultat Column\IColumn[]

getColumnsCount() public méthode

Get count of columns
public getColumnsCount ( ) : integer
Résultat integer

getColumnsSummary() public méthode

public getColumnsSummary ( ) : ColumnsSummary | null
Résultat ColumnsSummary | null

getColumnsVisibility() public méthode

getDataSource() public méthode

public getDataSource ( ) : Ublaboo\DataGrid\DataSource\IDataSource | null
Résultat Ublaboo\DataGrid\DataSource\IDataSource | null

getFilter() public méthode

Get defined filter
public getFilter ( string $key ) : Filter
$key string
Résultat Ublaboo\DataGrid\Filter\Filter

getFilterSubmitButton() public méthode

Submit button when no auto-submitting is used
public getFilterSubmitButton ( ) : SubmitButton
Résultat Ublaboo\DataGrid\Filter\SubmitButton

getGroupActionCollection() public méthode

Get collection of all group actions
public getGroupActionCollection ( ) : GroupActionCollection
Résultat Ublaboo\DataGrid\GroupAction\GroupActionCollection

getInlineAdd() public méthode

public getInlineAdd ( ) : InlineEdit | null
Résultat Ublaboo\DataGrid\InlineEdit\InlineEdit | null

getInlineEdit() public méthode

public getInlineEdit ( ) : InlineEdit | null
Résultat Ublaboo\DataGrid\InlineEdit\InlineEdit | null

getItemDetailForm() public méthode

public getItemDetailForm ( ) : Container | null
Résultat Nette\Forms\Container | null

getItemsDetail() public méthode

Get items detail parameters
public getItemsDetail ( ) : array
Résultat array

getItemsPerPageList() public méthode

Get associative array of items_per_page_list
public getItemsPerPageList ( ) : array
Résultat array

getOriginalTemplateFile() public méthode

Get DataGrid original template file
public getOriginalTemplateFile ( ) : string
Résultat string

getPaginator() public méthode

Return current paginator class
public getPaginator ( ) : null | DataGridPaginator
Résultat null | Ublaboo\DataGrid\Components\DataGridPaginator\DataGridPaginator

getParent() public méthode

public getParent ( ) : Nette\Application\UI\PresenterComponent
Résultat Nette\Application\UI\PresenterComponent

getPerPage() public méthode

Get parameter per_page
public getPerPage ( ) : integer
Résultat integer

getPrimaryKey() public méthode

Get primary key of datagrid data source
public getPrimaryKey ( ) : string
Résultat string

getRowCondition() public méthode

public getRowCondition ( string $name, string | null $key = NULL ) : boolean | callable
$name string
$key string | null
Résultat boolean | callable

getSessionData() public méthode

Get session data if functionality is enabled
public getSessionData ( string $key = NULL, $default_value = NULL ) : mixed
$key string
Résultat mixed

getSessionSectionName() public méthode

Find some unique session key name
public getSessionSectionName ( ) : string
Résultat string

getSortNext() public méthode

public getSortNext ( Column $column ) : array
$column Ublaboo\DataGrid\Column\Column
Résultat array

getSortableHandler() public méthode

Return sortable handle name
public getSortableHandler ( ) : string
Résultat string

getSortableParentPath() public méthode

public getSortableParentPath ( ) : strign
Résultat strign

getTemplateFile() public méthode

Get DataGrid template file
public getTemplateFile ( ) : static
Résultat static

getTranslator() public méthode

Get translator for datagrid
public getTranslator ( ) : Nette\Localization\ITranslator
Résultat Nette\Localization\ITranslator

handleActionCallback() public méthode

public handleActionCallback ( $__key, $__id )

handleChangeStatus() public méthode

Handler for column status
public handleChangeStatus ( string $id, string $key, string $value ) : void
$id string
$key string
$value string
Résultat void

handleEdit() public méthode

Handler for inline editing
public handleEdit ( mixed $id, mixed $key ) : void
$id mixed
$key mixed
Résultat void

handleExport() public méthode

Handler for export
public handleExport ( integer $id ) : void
$id integer Key for particular export class in array $this->exports
Résultat void

handleGetChildren() public méthode

Handler for getting children of parent item (e.g. category)
public handleGetChildren ( integer $parent ) : void
$parent integer
Résultat void

handleGetItemDetail() public méthode

Handler for getting item detail
public handleGetItemDetail ( mixed $id ) : void
$id mixed
Résultat void

handleHideColumn() public méthode

Notice datagrid to not display particular columns
public handleHideColumn ( string $column ) : void
$column string
Résultat void

handleInlineEdit() public méthode

public handleInlineEdit ( mixed $id ) : void
$id mixed
Résultat void

handlePage() public méthode

Handler for changind page (just refresh site with page as persistent paramter set)
public handlePage ( integer $page ) : void
$page integer
Résultat void

handleRefreshState() public méthode

Simply refresh url
public handleRefreshState ( ) : void
Résultat void

handleResetColumnFilter() public méthode

public handleResetColumnFilter ( string $key ) : void
$key string
Résultat void

handleResetFilter() public méthode

Handler for reseting the filter
public handleResetFilter ( ) : void
Résultat void

handleShowAllColumns() public méthode

Tell datagrid to display all columns
public handleShowAllColumns ( ) : void
Résultat void

handleShowColumn() public méthode

Reveal particular column
public handleShowColumn ( string $column ) : void
$column string
Résultat void

handleShowDefaultColumns() public méthode

Tell datagrid to display default columns
public handleShowDefaultColumns ( ) : void
Résultat void

handleSort() public méthode

Handler for sorting
public handleSort ( array $sort ) : void
$sort array
Résultat void

hasAutoSubmit() public méthode

public hasAutoSubmit ( ) : boolean
Résultat boolean

hasCollapsibleOuterFilters() public méthode

public hasCollapsibleOuterFilters ( ) : boolean
Résultat boolean

hasColumnReset() public méthode

public hasColumnReset ( ) : boolean
Résultat boolean

hasColumnsSummary() public méthode

Will datagrid show summary in the end?
public hasColumnsSummary ( ) : boolean
Résultat boolean

hasGroupActions() public méthode

Has datagrid some group actions?
public hasGroupActions ( ) : boolean
Résultat boolean

hasOuterFilterRendering() public méthode

Are datagrid filters rendered separately?
public hasOuterFilterRendering ( ) : boolean
Résultat boolean

hasSomeColumnDefaultHide() public méthode

Are some of columns hidden bydefault?

hasTreeViewChildrenCallback() public méthode

Is tree view children callback set?

isFilterActive() public méthode

Is filter active?
public isFilterActive ( ) : boolean
Résultat boolean

isMultiSortEnabled() public méthode

Tell wether DataGrid can be sorted by multiple columns
public isMultiSortEnabled ( ) : boolean
Résultat boolean

isPaginated() public méthode

Tell whether Grid is paginated
public isPaginated ( ) : boolean
Résultat boolean

isSortable() public méthode

Tell whether DataGrid is sortable
public isSortable ( ) : boolean
Résultat boolean

isTreeView() public méthode

Is tree view set?
public isTreeView ( ) : boolean
Résultat boolean

redrawItem() public méthode

Redraw just one row via ajax
public redrawItem ( integer $id, mixed $primary_where_column = NULL ) : void
$id integer
$primary_where_column mixed
Résultat void

reload() public méthode

Redraw $this
public reload ( $snippets = [] ) : void
Résultat void

removeAction() public méthode

Remove action
public removeAction ( string $key ) : void
$key string
Résultat void

removeColumn() public méthode

Remove column
public removeColumn ( string $key ) : void
$key string
Résultat void

removeFilter() public méthode

Remove filter
public removeFilter ( string $key ) : void
$key string
Résultat void

render() public méthode

Render template
public render ( ) : void
Résultat void

saveSessionData() public méthode

Save session data - just if it is enabled
public saveSessionData ( string $key, mixed $value ) : void
$key string
$value mixed
Résultat void

sendNonEmptyFiltersInPayload() public méthode

public sendNonEmptyFiltersInPayload ( Filter[] $filters ) : void
$filters Ublaboo\DataGrid\Filter\Filter[]
Résultat void

setAutoSubmit() public méthode

Tell grid filters to by submitted automatically
public setAutoSubmit ( boolean $auto = TRUE )
$auto boolean

setCollapsibleOuterFilters() public méthode

public setCollapsibleOuterFilters ( boolean $collapsible_outer_filters = TRUE )
$collapsible_outer_filters boolean

setColumnReset() public méthode

public setColumnReset ( boolean $reset = TRUE ) : static
$reset boolean
Résultat static

setColumnsExportOrder() public méthode

Columns order may be different for export and normal grid
public setColumnsExportOrder ( array $order )
$order array

setColumnsHideable() public méthode

Order Grid to set columns hideable.
public setColumnsHideable ( ) : static
Résultat static

setColumnsOrder() public méthode

Set order of datagrid columns
public setColumnsOrder ( array $order ) : static
$order array
Résultat static

setColumnsSummary() public méthode

Set columns to be summarized in the end.
public setColumnsSummary ( array $columns, callable $rowCallback = NULL ) : ColumnsSummary
$columns array
$rowCallback callable
Résultat ColumnsSummary

setDataSource() public méthode

Set Grid data source
public setDataSource ( Ublaboo\DataGrid\DataSource\IDataSource | array | DibiFluent | Selection | Doctrine\ORM\QueryBuilder $source ) : static
$source Ublaboo\DataGrid\DataSource\IDataSource | array | DibiFluent | Nette\Database\Table\Selection | Doctrine\ORM\QueryBuilder
Résultat static

setDefaultFilter() public méthode

If we want to sent some initial filter
public setDefaultFilter ( array $default_filter, boolean $use_on_reset = TRUE ) : static
$default_filter array
$use_on_reset boolean
Résultat static

setDefaultPerPage() public méthode

Set default "items per page" value in pagination select
public setDefaultPerPage ( $count ) : static
$count
Résultat static

setDefaultSort() public méthode

Set default sorting
public setDefaultSort ( array $sort ) : static
$sort array
Résultat static

setDefaultSort() public méthode

Set default sorting
public setDefaultSort ( array $sort, boolean $use_on_reset = TRUE ) : static
$sort array
$use_on_reset boolean
Résultat static

setFilter() public méthode

Set filter values (force - overwrite user data)
public setFilter ( array $filter ) : static
$filter array
Résultat static

setFilterActive() public méthode

Tell that filter is active from whatever reasons return static
public setFilterActive ( )

setFilterContainerDefaults() public méthode

public setFilterContainerDefaults ( Container $container, array $values )
$container Nette\Forms\Container
$values array

setFilterContainerDefaults() public méthode

public setFilterContainerDefaults ( Container $container, array | Iterator $values ) : void
$container Nette\Forms\Container
$values array | Iterator
Résultat void

setItemsDetail() public méthode

Items can have thair detail - toggled
public setItemsDetail ( mixed $detail = TRUE, boolean | null $primary_where_column = NULL ) : ItemDetail
$detail mixed callable|string|bool
$primary_where_column boolean | null
Résultat Ublaboo\DataGrid\Column\ItemDetail

setItemsDetailForm() public méthode

public setItemsDetailForm ( callable $callable_set_container ) : static
$callable_set_container callable
Résultat static

setItemsPerPageList() public méthode

Set options of select "items_per_page"
public setItemsPerPageList ( array $items_per_page_list, $include_all = TRUE ) : static
$items_per_page_list array
Résultat static

setMultiSortEnabled() public méthode

Enable multi-sorting capability
public setMultiSortEnabled ( boolean $multiSort = TRUE ) : void
$multiSort boolean
Résultat void

setOuterFilterRendering() public méthode

Should be datagrid filters rendered separately?
public setOuterFilterRendering ( boolean $out = TRUE ) : static
$out boolean
Résultat static

setPagination() public méthode

Order Grid to "be paginated"
public setPagination ( boolean $do ) : static
$do boolean
Résultat static

setPrimaryKey() public méthode

By default ID, you can change that
public setPrimaryKey ( string $primary_key ) : static
$primary_key string
Résultat static

setRefreshUrl() public méthode

Should datagrid refresh url using history API?
public setRefreshUrl ( boolean $refresh = TRUE ) : static
$refresh boolean
Résultat static

setRememberState() public méthode

Should datagrid remember its filters/pagination/etc using session?
public setRememberState ( boolean $remember = TRUE ) : static
$remember boolean
Résultat static

setRowCallback() public méthode

Each row can be modified with user callback
public setRowCallback ( callable $callback ) : static
$callback callable
Résultat static

setSomeColumnDefaultHide() public méthode

Some of datagrid columns is hidden by default
public setSomeColumnDefaultHide ( boolean $default_hide )
$default_hide boolean

setSortable() public méthode

Set grido to be sortable
public setSortable ( boolean $sortable = TRUE ) : static
$sortable boolean
Résultat static

setSortableHandler() public méthode

Set sortable handle
public setSortableHandler ( string $handler = 'sort!' ) : static
$handler string
Résultat static

setStrictSessionFilterValues() public méthode

public setStrictSessionFilterValues ( boolean $strict = TRUE )
$strict boolean

setTemplateFile() public méthode

Set custom template file to render
public setTemplateFile ( string $template_file ) : static
$template_file string
Résultat static

setTranslator() public méthode

Set datagrid translator
public setTranslator ( Nette\Localization\ITranslator $translator ) : static
$translator Nette\Localization\ITranslator
Résultat static

setTreeView() public méthode

Setting tree view
public setTreeView ( callable $get_children_callback, string | callable $tree_view_has_children_column = 'has_children' ) : static
$get_children_callback callable
$tree_view_has_children_column string | callable
Résultat static

treeViewChildrenCallback() public méthode

public treeViewChildrenCallback ( mixed $item ) : boolean
$item mixed
Résultat boolean

useHappyComponents() public méthode

Tell datagrid wheteher to use or not happy components
public useHappyComponents ( boolean | null $use = NULL ) : void | boolean
$use boolean | null If not given, return value of static::$use_happy_components
Résultat void | boolean

Property Details

$actions protected_oe property

protected Action[],Ublaboo\DataGrid\Column $actions
Résultat Ublaboo\DataGrid\Column\Action[]

$auto_submit protected_oe property

protected bool $auto_submit
Résultat boolean

$can_hide_columns protected_oe property

protected bool $can_hide_columns
Résultat boolean

$collapsible_outer_filters protected_oe property

protected bool $collapsible_outer_filters
Résultat boolean

$column_callbacks protected_oe property

protected array $column_callbacks
Résultat array

$columns protected_oe property

protected Column\IColumn[] $columns
Résultat Column\IColumn[]

$columnsSummary protected_oe property

protected ColumnsSummary,Ublaboo\DataGrid $columnsSummary
Résultat ColumnsSummary

$columns_export_order protected_oe property

protected array $columns_export_order
Résultat array

$columns_visibility protected_oe property

protected array $columns_visibility
Résultat array

$csv_export protected_oe property

protected bool $csv_export
Résultat boolean

$csv_export_filtered protected_oe property

protected bool $csv_export_filtered
Résultat boolean

$dataFilter protected_oe property

protected DataFilter $dataFilter
Résultat DataFilter

$dataModel protected_oe property

protected DataModel,Ublaboo\DataGrid $dataModel
Résultat DataModel

$default_filter public_oe property

public array $default_filter
Résultat array

$default_filter_use_on_reset public_oe property

public bool $default_filter_use_on_reset
Résultat boolean

$default_per_page protected_oe property

protected int $default_per_page
Résultat integer

$default_sort public_oe property

public array $default_sort
Résultat array

$default_sort_use_on_reset public_oe property

public bool $default_sort_use_on_reset
Résultat boolean

$do_paginate protected_oe property

protected bool $do_paginate
Résultat boolean

$exports protected_oe property

protected Export[],Ublaboo\DataGrid\Export $exports
Résultat Ublaboo\DataGrid\Export\Export[]

$filter public_oe property

public array $filter
Résultat array

$filter_submit_button protected_oe property

protected SubmitButton,Ublaboo\DataGrid\Filter|NULL $filter_submit_button
Résultat Ublaboo\DataGrid\Filter\SubmitButton | null

$filters protected_oe property

protected Filter[],Ublaboo\DataGrid\Filter $filters
Résultat Ublaboo\DataGrid\Filter\Filter[]

$force_filter_active protected_oe property

protected bool $force_filter_active
Résultat boolean

$form_method public_oe static_oe property

Default form method
public static string $form_method
Résultat string

$grid_session protected_oe property

protected SessionSection,Nette\Http $grid_session
Résultat Nette\Http\SessionSection

$group_action_collection protected_oe property

protected GroupActionCollection,Ublaboo\DataGrid\GroupAction $group_action_collection
Résultat Ublaboo\DataGrid\GroupAction\GroupActionCollection

$has_column_reset protected_oe property

protected bool $has_column_reset
Résultat boolean

$icon_prefix public_oe static_oe property

public static string $icon_prefix
Résultat string

$inlineAdd protected_oe property

protected InlineEdit,Ublaboo\DataGrid\InlineEdit $inlineAdd
Résultat Ublaboo\DataGrid\InlineEdit\InlineEdit

$inlineEdit protected_oe property

protected InlineEdit,Ublaboo\DataGrid\InlineEdit $inlineEdit
Résultat Ublaboo\DataGrid\InlineEdit\InlineEdit

$items_detail protected_oe property

protected ItemDetail,Ublaboo\DataGrid\Column $items_detail
Résultat Ublaboo\DataGrid\Column\ItemDetail

$items_per_page_list protected_oe property

protected array $items_per_page_list
Résultat array

$multiSort protected_oe property

protected bool $multiSort
Résultat boolean

$onColumnAdd public_oe property

public callable[] $onColumnAdd
Résultat callable[]

$onExport public_oe property

public callable[] $onExport
Résultat callable[]

$onFiltersAssabled public_oe property

public callable[] $onFiltersAssabled
Résultat callable[]

$onRedraw public_oe property

public callable[] $onRedraw
Résultat callable[]

$onRender public_oe property

public callable[] $onRender
Résultat callable[]

$original_template protected_oe property

protected string $original_template
Résultat string

$outer_filter_rendering protected_oe property

protected bool $outer_filter_rendering
Résultat boolean

$page public_oe property

public int $page
Résultat integer

$per_page public_oe property

public int|string $per_page
Résultat integer | string

$primary_key protected_oe property

protected string $primary_key
Résultat string

$redraw_item protected_oe property

protected array $redraw_item
Résultat array

$refresh_url protected_oe property

protected bool $refresh_url
Résultat boolean

$remember_state protected_oe property

protected bool $remember_state
Résultat boolean

$rowCallback protected_oe property

protected callable $rowCallback
Résultat callable

$row_conditions protected_oe property

protected array $row_conditions
Résultat array

$snippets_set protected_oe property

protected bool $snippets_set
Résultat boolean

$some_column_default_hide protected_oe property

protected bool $some_column_default_hide
Résultat boolean

$sort public_oe property

public array $sort
Résultat array

$sort_callback protected_oe property

protected callable|null $sort_callback
Résultat callable | null

$sortable protected_oe property

protected bool $sortable
Résultat boolean

$sortable_handler protected_oe property

protected string $sortable_handler
Résultat string

$strict_entity_property public_oe property

When set to TRUE, datagrid throws an exception when tring to get related entity within join and entity does not exist
public bool $strict_entity_property
Résultat boolean

$strict_session_filter_values public_oe property

When set to TRUE, datagrid throws an exception when tring to set filter value, that does not exist (select, multiselect, etc)
public bool $strict_session_filter_values
Résultat boolean

$template_file protected_oe property

protected string $template_file
Résultat string

$toolbar_buttons protected_oe property

protected ToolbarButton[],Ublaboo\DataGrid\Toolbar $toolbar_buttons
Résultat Ublaboo\DataGrid\Toolbar\ToolbarButton[]

$translator protected_oe property

protected mixed $translator
Résultat mixed

$tree_view_children_callback protected_oe property

protected callable $tree_view_children_callback
Résultat callable

$tree_view_has_children_callback protected_oe property

protected callable $tree_view_has_children_callback
Résultat callable

$tree_view_has_children_column protected_oe property

protected string $tree_view_has_children_column
Résultat string

$use_happy_components protected_oe property

protected bool $use_happy_components
Résultat boolean