PHP Class Ublaboo\DataGrid\DataGrid

Inheritance: extends Nette\Application\UI\Control
Exibir arquivo Open project: ublaboo/datagrid Class Usage Examples

Public Properties

Property 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

Property 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

Public Methods

Method 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

Protected Methods

Method 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 method

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

addAction() public method

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

addActionCallback() public method

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

addActionCheck() protected method

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

addColumn() protected method

protected addColumn ( string $key, Column $column ) : Column
$key string
$column Ublaboo\DataGrid\Column\Column
return Ublaboo\DataGrid\Column\Column

addColumnCallback() public method

public addColumnCallback ( string $key, callable $callback ) : void
$key string
$callback callable
return void

addColumnCheck() protected method

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

addColumnDateTime() public method

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

addColumnNumber() public method

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

addColumnStatus() public method

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

addColumnText() public method

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
return Column\ColumnText

addExportCallback() public method

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

addExportCsv() public method

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
return Ublaboo\DataGrid\Export\Export

addExportCsvFiltered() public method

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
return Ublaboo\DataGrid\Export\Export

addFilterCheck() protected method

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

addFilterDate() public method

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

addFilterDateRange() public method

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

addFilterMultiSelect() public method

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
return Ublaboo\DataGrid\Filter\FilterSelect

addFilterRange() public method

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

addFilterSelect() public method

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

addFilterText() public method

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

addGroupAction() public method

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

addGroupSelectAction() public method

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

addGroupTextAction() public method

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

addGroupTextareaAction() public method

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

addInlineAdd() public method

public addInlineAdd ( ) : InlineEdit
return Ublaboo\DataGrid\InlineEdit\InlineEdit

addInlineEdit() public method

public addInlineEdit ( $primary_where_column = NULL ) : InlineEdit
return Ublaboo\DataGrid\InlineEdit\InlineEdit

addMultiAction() public method

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

addToExports() protected method

Add export to array
protected addToExports ( Export $export ) : Export
$export Ublaboo\DataGrid\Export\Export
return Ublaboo\DataGrid\Export\Export

addToolbarButton() public method

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

allowRowsAction() public method

public allowRowsAction ( string $key, callable $condition ) : void
$key string
$condition callable
return void

allowRowsGroupAction() public method

public allowRowsGroupAction ( callable $condition ) : void
$condition callable
return void

allowRowsInlineEdit() public method

public allowRowsInlineEdit ( callable $condition ) : void
$condition callable
return void

assableFilters() public method

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[]
return Ublaboo\DataGrid\Filter\Filter[] $this->filters === Filter\Filter[]

attached() public method

{inheritDoc}
public attached ( $presenter ) : void
return void

canHideColumns() public method

Can datagrid hide colums?
public canHideColumns ( ) : boolean
return boolean

createComponentFilter() public method

FilterAndGroupAction form factory
public createComponentFilter ( ) : Nette\Application\UI\Form
return Nette\Application\UI\Form

createComponentPaginator() public method

Paginator factory
public createComponentPaginator ( ) : DataGridPaginator
return Ublaboo\DataGrid\Components\DataGridPaginator\DataGridPaginator

createSorting() protected method

protected createSorting ( array $sort, callable $sort_callback = NULL ) : void
$sort array
$sort_callback callable
return void

createSorting() protected method

protected createSorting ( array $sort, callable | null $sort_callback ) : void
$sort array
$sort_callback callable | null
return void

deleteSessionData() public method

Delete session data
public deleteSessionData ( $key ) : void
return void

deleteSesssionData() public method

Delete session data
Deprecation:
public deleteSesssionData ( $key ) : void
return void

filterSucceeded() public method

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

findDefaultFilter() public method

User may set default filter, find it
public findDefaultFilter ( ) : void
return void

findDefaultPerPage() public method

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

findDefaultSort() public method

User may set default sorting, apply it
public findDefaultSort ( ) : void
return void

findSessionValues() public method

Try to restore session stuff
public findSessionValues ( ) : void
return void

getAction() public method

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

getColumn() public method

Return existing column
public getColumn ( string $key ) : Column
$key string
return Ublaboo\DataGrid\Column\Column

getColumnCallback() public method

public getColumnCallback ( string $key ) : callable | null
$key string
return callable | null

getColumns() public method

Get set of set columns
public getColumns ( ) : Column\IColumn[]
return Column\IColumn[]

getColumnsCount() public method

Get count of columns
public getColumnsCount ( ) : integer
return integer

getColumnsSummary() public method

public getColumnsSummary ( ) : ColumnsSummary | null
return ColumnsSummary | null

getColumnsVisibility() public method

getDataSource() public method

public getDataSource ( ) : Ublaboo\DataGrid\DataSource\IDataSource | null
return Ublaboo\DataGrid\DataSource\IDataSource | null

getFilter() public method

Get defined filter
public getFilter ( string $key ) : Filter
$key string
return Ublaboo\DataGrid\Filter\Filter

getFilterSubmitButton() public method

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

getGroupActionCollection() public method

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

getInlineAdd() public method

public getInlineAdd ( ) : InlineEdit | null
return Ublaboo\DataGrid\InlineEdit\InlineEdit | null

getInlineEdit() public method

public getInlineEdit ( ) : InlineEdit | null
return Ublaboo\DataGrid\InlineEdit\InlineEdit | null

getItemDetailForm() public method

public getItemDetailForm ( ) : Container | null
return Nette\Forms\Container | null

getItemsDetail() public method

Get items detail parameters
public getItemsDetail ( ) : array
return array

getItemsPerPageList() public method

Get associative array of items_per_page_list
public getItemsPerPageList ( ) : array
return array

getOriginalTemplateFile() public method

Get DataGrid original template file
public getOriginalTemplateFile ( ) : string
return string

getPaginator() public method

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

getParent() public method

public getParent ( ) : Nette\Application\UI\PresenterComponent
return Nette\Application\UI\PresenterComponent

getPerPage() public method

Get parameter per_page
public getPerPage ( ) : integer
return integer

getPrimaryKey() public method

Get primary key of datagrid data source
public getPrimaryKey ( ) : string
return string

getRowCondition() public method

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

getSessionData() public method

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

getSessionSectionName() public method

Find some unique session key name
public getSessionSectionName ( ) : string
return string

getSortNext() public method

public getSortNext ( Column $column ) : array
$column Ublaboo\DataGrid\Column\Column
return array

getSortableHandler() public method

Return sortable handle name
public getSortableHandler ( ) : string
return string

getSortableParentPath() public method

public getSortableParentPath ( ) : strign
return strign

getTemplateFile() public method

Get DataGrid template file
public getTemplateFile ( ) : static
return static

getTranslator() public method

Get translator for datagrid
public getTranslator ( ) : Nette\Localization\ITranslator
return Nette\Localization\ITranslator

handleActionCallback() public method

public handleActionCallback ( $__key, $__id )

handleChangeStatus() public method

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

handleEdit() public method

Handler for inline editing
public handleEdit ( mixed $id, mixed $key ) : void
$id mixed
$key mixed
return void

handleExport() public method

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

handleGetChildren() public method

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

handleGetItemDetail() public method

Handler for getting item detail
public handleGetItemDetail ( mixed $id ) : void
$id mixed
return void

handleHideColumn() public method

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

handleInlineEdit() public method

public handleInlineEdit ( mixed $id ) : void
$id mixed
return void

handlePage() public method

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

handleRefreshState() public method

Simply refresh url
public handleRefreshState ( ) : void
return void

handleResetColumnFilter() public method

public handleResetColumnFilter ( string $key ) : void
$key string
return void

handleResetFilter() public method

Handler for reseting the filter
public handleResetFilter ( ) : void
return void

handleShowAllColumns() public method

Tell datagrid to display all columns
public handleShowAllColumns ( ) : void
return void

handleShowColumn() public method

Reveal particular column
public handleShowColumn ( string $column ) : void
$column string
return void

handleShowDefaultColumns() public method

Tell datagrid to display default columns
public handleShowDefaultColumns ( ) : void
return void

handleSort() public method

Handler for sorting
public handleSort ( array $sort ) : void
$sort array
return void

hasAutoSubmit() public method

public hasAutoSubmit ( ) : boolean
return boolean

hasCollapsibleOuterFilters() public method

hasColumnReset() public method

public hasColumnReset ( ) : boolean
return boolean

hasColumnsSummary() public method

Will datagrid show summary in the end?
public hasColumnsSummary ( ) : boolean
return boolean

hasGroupActions() public method

Has datagrid some group actions?
public hasGroupActions ( ) : boolean
return boolean

hasOuterFilterRendering() public method

Are datagrid filters rendered separately?

hasSomeColumnDefaultHide() public method

Are some of columns hidden bydefault?

hasTreeViewChildrenCallback() public method

Is tree view children callback set?

isFilterActive() public method

Is filter active?
public isFilterActive ( ) : boolean
return boolean

isMultiSortEnabled() public method

Tell wether DataGrid can be sorted by multiple columns
public isMultiSortEnabled ( ) : boolean
return boolean

isPaginated() public method

Tell whether Grid is paginated
public isPaginated ( ) : boolean
return boolean

isSortable() public method

Tell whether DataGrid is sortable
public isSortable ( ) : boolean
return boolean

isTreeView() public method

Is tree view set?
public isTreeView ( ) : boolean
return boolean

redrawItem() public method

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

reload() public method

Redraw $this
public reload ( $snippets = [] ) : void
return void

removeAction() public method

Remove action
public removeAction ( string $key ) : void
$key string
return void

removeColumn() public method

Remove column
public removeColumn ( string $key ) : void
$key string
return void

removeFilter() public method

Remove filter
public removeFilter ( string $key ) : void
$key string
return void

render() public method

Render template
public render ( ) : void
return void

saveSessionData() public method

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

sendNonEmptyFiltersInPayload() public method

public sendNonEmptyFiltersInPayload ( Filter[] $filters ) : void
$filters Ublaboo\DataGrid\Filter\Filter[]
return void

setAutoSubmit() public method

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

setCollapsibleOuterFilters() public method

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

setColumnReset() public method

public setColumnReset ( boolean $reset = TRUE ) : static
$reset boolean
return static

setColumnsExportOrder() public method

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

setColumnsHideable() public method

Order Grid to set columns hideable.
public setColumnsHideable ( ) : static
return static

setColumnsOrder() public method

Set order of datagrid columns
public setColumnsOrder ( array $order ) : static
$order array
return static

setColumnsSummary() public method

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

setDataSource() public method

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
return static

setDefaultFilter() public method

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
return static

setDefaultPerPage() public method

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

setDefaultSort() public method

Set default sorting
public setDefaultSort ( array $sort ) : static
$sort array
return static

setDefaultSort() public method

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

setFilter() public method

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

setFilterActive() public method

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

setFilterContainerDefaults() public method

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

setFilterContainerDefaults() public method

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

setItemsDetail() public method

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
return Ublaboo\DataGrid\Column\ItemDetail

setItemsDetailForm() public method

public setItemsDetailForm ( callable $callable_set_container ) : static
$callable_set_container callable
return static

setItemsPerPageList() public method

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

setMultiSortEnabled() public method

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

setOuterFilterRendering() public method

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

setPagination() public method

Order Grid to "be paginated"
public setPagination ( boolean $do ) : static
$do boolean
return static

setPrimaryKey() public method

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

setRefreshUrl() public method

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

setRememberState() public method

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

setRowCallback() public method

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

setSomeColumnDefaultHide() public method

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

setSortable() public method

Set grido to be sortable
public setSortable ( boolean $sortable = TRUE ) : static
$sortable boolean
return static

setSortableHandler() public method

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

setStrictSessionFilterValues() public method

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

setTemplateFile() public method

Set custom template file to render
public setTemplateFile ( string $template_file ) : static
$template_file string
return static

setTranslator() public method

Set datagrid translator
public setTranslator ( Nette\Localization\ITranslator $translator ) : static
$translator Nette\Localization\ITranslator
return static

setTreeView() public method

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
return static

treeViewChildrenCallback() public method

public treeViewChildrenCallback ( mixed $item ) : boolean
$item mixed
return boolean

useHappyComponents() public method

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
return void | boolean

Property Details

$actions protected_oe property

protected Action[],Ublaboo\DataGrid\Column $actions
return Ublaboo\DataGrid\Column\Action[]

$auto_submit protected_oe property

protected bool $auto_submit
return boolean

$can_hide_columns protected_oe property

protected bool $can_hide_columns
return boolean

$collapsible_outer_filters protected_oe property

protected bool $collapsible_outer_filters
return boolean

$column_callbacks protected_oe property

protected array $column_callbacks
return array

$columns protected_oe property

protected Column\IColumn[] $columns
return Column\IColumn[]

$columnsSummary protected_oe property

protected ColumnsSummary,Ublaboo\DataGrid $columnsSummary
return ColumnsSummary

$columns_export_order protected_oe property

protected array $columns_export_order
return array

$columns_visibility protected_oe property

protected array $columns_visibility
return array

$csv_export protected_oe property

protected bool $csv_export
return boolean

$csv_export_filtered protected_oe property

protected bool $csv_export_filtered
return boolean

$dataFilter protected_oe property

protected DataFilter $dataFilter
return DataFilter

$dataModel protected_oe property

protected DataModel,Ublaboo\DataGrid $dataModel
return DataModel

$default_filter public_oe property

public array $default_filter
return array

$default_filter_use_on_reset public_oe property

public bool $default_filter_use_on_reset
return boolean

$default_per_page protected_oe property

protected int $default_per_page
return integer

$default_sort public_oe property

public array $default_sort
return array

$default_sort_use_on_reset public_oe property

public bool $default_sort_use_on_reset
return boolean

$do_paginate protected_oe property

protected bool $do_paginate
return boolean

$exports protected_oe property

protected Export[],Ublaboo\DataGrid\Export $exports
return Ublaboo\DataGrid\Export\Export[]

$filter public_oe property

public array $filter
return array

$filter_submit_button protected_oe property

protected SubmitButton,Ublaboo\DataGrid\Filter|NULL $filter_submit_button
return Ublaboo\DataGrid\Filter\SubmitButton | null

$filters protected_oe property

protected Filter[],Ublaboo\DataGrid\Filter $filters
return Ublaboo\DataGrid\Filter\Filter[]

$force_filter_active protected_oe property

protected bool $force_filter_active
return boolean

$form_method public_oe static_oe property

Default form method
public static string $form_method
return string

$grid_session protected_oe property

protected SessionSection,Nette\Http $grid_session
return Nette\Http\SessionSection

$group_action_collection protected_oe property

protected GroupActionCollection,Ublaboo\DataGrid\GroupAction $group_action_collection
return Ublaboo\DataGrid\GroupAction\GroupActionCollection

$has_column_reset protected_oe property

protected bool $has_column_reset
return boolean

$icon_prefix public_oe static_oe property

public static string $icon_prefix
return string

$inlineAdd protected_oe property

protected InlineEdit,Ublaboo\DataGrid\InlineEdit $inlineAdd
return Ublaboo\DataGrid\InlineEdit\InlineEdit

$inlineEdit protected_oe property

protected InlineEdit,Ublaboo\DataGrid\InlineEdit $inlineEdit
return Ublaboo\DataGrid\InlineEdit\InlineEdit

$items_detail protected_oe property

protected ItemDetail,Ublaboo\DataGrid\Column $items_detail
return Ublaboo\DataGrid\Column\ItemDetail

$items_per_page_list protected_oe property

protected array $items_per_page_list
return array

$multiSort protected_oe property

protected bool $multiSort
return boolean

$onColumnAdd public_oe property

public callable[] $onColumnAdd
return callable[]

$onExport public_oe property

public callable[] $onExport
return callable[]

$onFiltersAssabled public_oe property

public callable[] $onFiltersAssabled
return callable[]

$onRedraw public_oe property

public callable[] $onRedraw
return callable[]

$onRender public_oe property

public callable[] $onRender
return callable[]

$original_template protected_oe property

protected string $original_template
return string

$outer_filter_rendering protected_oe property

protected bool $outer_filter_rendering
return boolean

$page public_oe property

public int $page
return integer

$per_page public_oe property

public int|string $per_page
return integer | string

$primary_key protected_oe property

protected string $primary_key
return string

$redraw_item protected_oe property

protected array $redraw_item
return array

$refresh_url protected_oe property

protected bool $refresh_url
return boolean

$remember_state protected_oe property

protected bool $remember_state
return boolean

$rowCallback protected_oe property

protected callable $rowCallback
return callable

$row_conditions protected_oe property

protected array $row_conditions
return array

$snippets_set protected_oe property

protected bool $snippets_set
return boolean

$some_column_default_hide protected_oe property

protected bool $some_column_default_hide
return boolean

$sort public_oe property

public array $sort
return array

$sort_callback protected_oe property

protected callable|null $sort_callback
return callable | null

$sortable protected_oe property

protected bool $sortable
return boolean

$sortable_handler protected_oe property

protected string $sortable_handler
return 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
return 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
return boolean

$template_file protected_oe property

protected string $template_file
return string

$toolbar_buttons protected_oe property

protected ToolbarButton[],Ublaboo\DataGrid\Toolbar $toolbar_buttons
return Ublaboo\DataGrid\Toolbar\ToolbarButton[]

$translator protected_oe property

protected mixed $translator
return mixed

$tree_view_children_callback protected_oe property

protected callable $tree_view_children_callback
return callable

$tree_view_has_children_callback protected_oe property

protected callable $tree_view_has_children_callback
return callable

$tree_view_has_children_column protected_oe property

protected string $tree_view_has_children_column
return string

$use_happy_components protected_oe property

protected bool $use_happy_components
return boolean