Grido@master
  • Namespace
  • Class
  • Tree
  • Deprecated
  • Todo
  • Download

Namespaces

  • Grido
    • Components
      • Actions
      • Columns
      • Filters
    • DataSources
    • PropertyAccessors
    • Translations

Classes

  • Grid
  • Helpers

Class Grid

Grido - DataGrid for Nette Framework.

Nette\Application\UI\Control
Extended by Grido\Components\Container
Extended by Grido\Grid
Namespace: Grido
Package: Grido
Author: Petr Bugyík
Located at Grid.php

Methods summary

public Grido\Grid
# setModel( mixed $model, boolean $forceWrapper = FALSE )

Sets a model that implements the interface Grido\DataSources\IDataSource or data-source object.

Sets a model that implements the interface Grido\DataSources\IDataSource or data-source object.

Parameters

$model
$forceWrapper

Returns

Grido\Grid

Throws

InvalidArgumentException
public Grido\Grid
# setPropertyAccessor( Grido\PropertyAccessors\IPropertyAccessor $propertyAccessor )

Sets a property accesor that implements the interface Grido\PropertyAccessors\IPropertyAccessor.

Sets a property accesor that implements the interface Grido\PropertyAccessors\IPropertyAccessor.

Parameters

$propertyAccessor

Returns

Grido\Grid
public Grido\Grid
# setDefaultPerPage( integer $perPage )

Sets the default number of items per page.

Sets the default number of items per page.

Parameters

$perPage

Returns

Grido\Grid
public Grido\Grid
# setDefaultFilter( array $filter )

Sets default filtering.

Sets default filtering.

Parameters

$filter

Returns

Grido\Grid
public Grido\Grid
# setDefaultSort( array $sort )

Sets default sorting.

Sets default sorting.

Parameters

$sort

Returns

Grido\Grid

Throws

InvalidArgumentException
public Grido\Grid
# setPerPageList( array $perPageList )

Sets items to per-page select.

Sets items to per-page select.

Parameters

$perPageList

Returns

Grido\Grid
public Grido\Grid
# setTranslator( Nette\Localization\ITranslator $translator )

Sets translator.

Sets translator.

Parameters

$translator

Returns

Grido\Grid
public Grido\Grid
# setFilterRenderType( string $type )

Sets type of filter rendering. Defaults inner (Filter::RENDER_INNER) if column does not exist then outer filter (Filter::RENDER_OUTER).

Sets type of filter rendering. Defaults inner (Filter::RENDER_INNER) if column does not exist then outer filter (Filter::RENDER_OUTER).

Parameters

$type

Returns

Grido\Grid

Throws

InvalidArgumentException
public Grido\Grid
# setPaginator( Grido\Components\Paginator $paginator )

Sets custom paginator.

Sets custom paginator.

Parameters

$paginator

Returns

Grido\Grid
public Grido\Grid
# setPrimaryKey( string $key )

Sets grid primary key. Defaults is "id".

Sets grid primary key. Defaults is "id".

Parameters

$key

Returns

Grido\Grid
public Grido\Grid
# setTemplateFile( string $file )

Sets file name of custom template.

Sets file name of custom template.

Parameters

$file

Returns

Grido\Grid
public Grido\Grid
# setRememberState( boolean $state = TRUE )

Sets saving state to session.

Sets saving state to session.

Parameters

$state

Returns

Grido\Grid
public Grido\Grid
# setRowCallback( $callback )

Sets callback for customizing tr html object. Callback returns tr html element; function($row, Html $tr).

Sets callback for customizing tr html object. Callback returns tr html element; function($row, Html $tr).

Parameters

$callback

Returns

Grido\Grid
public Grido\Grid
# setClientSideOptions( array $options )

Sets client-side options.

Sets client-side options.

Parameters

$options

Returns

Grido\Grid
public integer
# getCount( )

Returns total count of data.

Returns total count of data.

Returns

integer
public integer
# getDefaultPerPage( )

Returns default per page.

Returns default per page.

Returns

integer
public array
# getDefaultFilter( )

Returns default filter.

Returns default filter.

Returns

array
public array
# getDefaultSort( )

Returns default sort.

Returns default sort.

Returns

array
public array
# getPerPageList( )

Returns list of possible items per page.

Returns list of possible items per page.

Returns

array
public string
# getPrimaryKey( )

Returns primary key.

Returns primary key.

Returns

string
public boolean
# getRememberState( )

Returns remember state.

Returns remember state.

Returns

boolean
public callable
# getRowCallback( )

Returns row callback.

Returns row callback.

Returns

callable
public integer
# getPerPage( )

Returns items per page.

Returns items per page.

Returns

integer
public mixed
# getActualFilter( string $key = NULL )

Returns actual filter values.

Returns actual filter values.

Parameters

$key

Returns

mixed
public array
# getData( boolean $applyPaging = TRUE, boolean $useCache = TRUE )

Returns fetched data.

Returns fetched data.

Parameters

$applyPaging
$useCache

Returns

array

Throws

Exception
public Grido\Translations\FileTranslator
# getTranslator( )

Returns translator.

Returns translator.

Returns

Grido\Translations\FileTranslator
public Nette\Http\SessionSection|null
# getRememberSession( boolean $forceStart = FALSE )

Returns remember session for set expiration, etc.

Returns remember session for set expiration, etc.

Parameters

$forceStart
  • if TRUE, session will be started if not

Returns

Nette\Http\SessionSection|null
public Nette\Utils\Html
# getTablePrototype( )

Returns table html element of grid.

Returns table html element of grid.

Returns

Nette\Utils\Html
public array
# getClientSideOptions( )

Returns client-side options.

Returns client-side options.

Returns

array
protected
# saveRememberState( )
protected
# applyFiltering( )
protected
# applySorting( )
protected
# applyPaging( )
protected
# createComponentForm( $name )
protected array
# getItemsForCountSelect( )

Returns

array

Methods inherited from Grido\Components\Container

addActionEvent(), addActionHref(), addColumnDate(), addColumnEmail(), addColumnHref(), addColumnLink(), addColumnMail(), addColumnNumber(), addColumnText(), addFilterCheck(), addFilterCustom(), addFilterDate(), addFilterDateRange(), addFilterNumber(), addFilterSelect(), addFilterText(), getAction(), getColumn(), getExport(), getFilter(), getOperation(), setEditableColumns(), setExport(), setOperation()

Magic methods summary

Constants summary

string BUTTONS
# 'buttons'
string CLIENT_SIDE_OPTIONS
# 'grido-options'

Properties summary

public integer $page

@persistent

@persistent

# 1
public integer $perPage

@persistent

@persistent

#
public array $sort

@persistent

@persistent

# array()
public array $filter

@persistent

@persistent

# array()
public array $onRegistered

event on all grid's components registered

event on all grid's components registered

#
public array $onRender

event on render

event on render

#
public array $onFetchData

event for modifying data

event for modifying data

#
protected callable $rowCallback

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

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

#
protected Nette\Utils\Html $tablePrototype
#
protected boolean $rememberState
# FALSE
protected string $primaryKey
# 'id'
protected string $filterRenderType
#
protected array $perPageList
# array(10, 20, 30, 50, 100)
protected integer $defaultPerPage
# 20
protected array $defaultFilter
# array()
protected array $defaultSort
# array()
protected Grido\DataSources\IDataSource $model
#
protected integer $count

total count of items

total count of items

#
protected mixed $data
#
protected Grido\Components\Paginator $paginator
#
protected Nette\Localization\ITranslator $translator
#
protected Grido\PropertyAccessors\IPropertyAccessor $propertyAccessor
#

Properties inherited from Grido\Components\Container

$hasActions, $hasColumns, $hasExport, $hasFilters, $hasOperation

Magic properties

public boolean $rememberState
public array $defaultPerPage
public array $defaultFilter
public array $defaultSort
public array $perPageList
public Nette\Localization\ITranslator $translator
public Grido\Components\Paginator $paginator
public string $primaryKey
public string $filterRenderType
public Grido\DataSources\IDataSource $model
public Grido\PropertyAccessors\IPropertyAccessor $propertyAccessor
public callable $rowCallback
public read-only integer $count
public read-only mixed $data
public read-only Nette\Utils\Html $tablePrototype
public write-only string $templateFile
Grido@master API documentation generated by ApiGen