PHP Class Grido\Components\Actions\Action

Author: Petr Bugyík
Inheritance: extends Grido\Components\Component
Show file Open project: o5/grido Class Usage Examples

Protected Properties

Property Type Description
$customRender for custom rendering
$disable for disabling
$elementPrototype html tag
$options string
$primaryKey - name of primary key f.e.: link->('Article:edit', array($primaryKey => 1))

Public Methods

Method Description
__construct ( Grid $grid, string $name, string $label )
getElement ( mixed $row ) : Nette\Utils\Html
getElementPrototype ( ) : Nette\Utils\Html Returns element prototype ( html tag).
getOption ( string $key, mixed $default = NULL ) : mixed Returns user-specific option.
getOptions ( ) : array Returns user-specific options.
getPrimaryKey ( ) : string
render ( mixed $row ) : void
setConfirm ( string | callback $confirm ) : Action Sets client side confirm.
setCustomRender ( $callback ) : Action Sets callback for custom rendering.
setDisable ( $callback ) : Action Sets callback for disable.
setElementPrototype ( Nette\Utils\Html $elementPrototype ) : Action Sets html element.
setIcon ( string $name ) : Action Sets name of icon.
setOption ( string $key, mixed $value ) : Action Sets user-specific option.
setPrimaryKey ( string $primaryKey ) : Action Sets primary key.

Method Details

__construct() public method

public __construct ( Grid $grid, string $name, string $label )
$grid Grido\Grid
$name string
$label string

getElement() public method

public getElement ( mixed $row ) : Nette\Utils\Html
$row mixed
return Nette\Utils\Html
Returns user-specific option.
public getOption ( string $key, mixed $default = NULL ) : mixed
$key string
$default mixed
return mixed

getOptions() public method

Returns user-specific options.
public getOptions ( ) : array
return array

getPrimaryKey() public method

public getPrimaryKey ( ) : string
return string

render() public method

public render ( mixed $row ) : void
$row mixed
return void

setConfirm() public method

Sets client side confirm.
public setConfirm ( string | callback $confirm ) : Action
$confirm string | callback
return Action

setCustomRender() public method

Sets callback for custom rendering.
public setCustomRender ( $callback ) : Action
return Action

setDisable() public method

Callback should return TRUE if the action is not allowed for current item.
public setDisable ( $callback ) : Action
return Action

setElementPrototype() public method

Sets html element.
public setElementPrototype ( Nette\Utils\Html $elementPrototype ) : Action
$elementPrototype Nette\Utils\Html
return Action

setIcon() public method

Sets name of icon.
public setIcon ( string $name ) : Action
$name string
return Action

setOption() public method

Sets user-specific option.
public setOption ( string $key, mixed $value ) : Action
$key string
$value mixed
return Action

setPrimaryKey() public method

Sets primary key.
public setPrimaryKey ( string $primaryKey ) : Action
$primaryKey string
return Action

Property Details

$customRender protected property

for custom rendering
protected $customRender

$disable protected property

for disabling
protected $disable

$elementPrototype protected property

protected $elementPrototype
protected string $options
return string

$primaryKey protected property

- name of primary key f.e.: link->('Article:edit', array($primaryKey => 1))
protected $primaryKey