Constants

COLUMN_SELECTION

COLUMN_SELECTION

SORT_DIR_UP

SORT_DIR_UP

SORT_DIR_DOWN

SORT_DIR_DOWN

ITEMS_UNLIMITED

ITEMS_UNLIMITED

Properties

$_columns

$_columns : array

List columns

Type

array

$_data

$_data : array

List data

Type

array

$_tools

$_tools : array

List tools

Type

array

$_dataUrl

$_dataUrl : array|string

URL for retrieving list data

Type

array|string

$_pageable

$_pageable : boolean

Paging allowed

Type

boolean

$_defaultItemsPerPage

$_defaultItemsPerPage : integer

Default value of items per page

Type

integer

$_defaultSortField

$_defaultSortField : string

Default sort field

Type

string

$_defaultSortDirection

$_defaultSortDirection : string

Default sort direction Must be self::SORT_DIR_UP or self::SORT_DIR_DOWN

Type

string

$_options

$_options : array

List context options

Type

array

Methods

__construct()

__construct(\Zend_View  $view, \Zend_Controller_Request_Abstract  $request, array  $options = array()) 

Create list

$options = [
    'pageable' => boolean,
    'defaultItemsPerPage' => int,
    'defaultSortField' => string,
    'defaultSortDirection' => string,
    'dataUrl' => array|string,
    'columns' => array,
    'data' => array,
    'tools' => array,
]

Parameters

\Zend_View $view
\Zend_Controller_Request_Abstract $request
array $options

Additional options available in $this->_options property

setColumns()

setColumns(array  $columns) 

Set list columns from associated array

[
    'first-column-id' => [
        'title' => string,
        'noEscape' => bool,
        'searchable' => bool,
        'sortable' => bool,
    ],
    ...
]

Parameters

array $columns

addSearchFilters()

addSearchFilters(array  $filters) 

add search filters from associated array

[
    'column-id' =>
    [
        'title' => string,
        'fields' => [string, string],
        'options' => [string => string],
    ]
]

Parameters

array $filters

setData()

setData(array  $data) 

Set list data from associated array

[
    [
        'first-column-id' => string,
    ],
    ...
]

Parameters

array $data

fetchData()

fetchData() : array

Fetch list data

Returns

array

setDataUrl()

setDataUrl(array|string  $params) 

Set URL for retrieving list data

[
    'controller' => string,
    'action' => string,
    'link' => string,
]

Parameters

array|string $params

setTools()

setTools(array  $tools) 

Set list tools from associated array

[
    [
        'title' => string,
        'description' => string,
        'class' => string,
        'controller' => string,
        'action' => string,
        'link' => string,
        'execGroupOperation' => string|[
            'url' => string,
            'submitHandler' => 'function(url, ids) {}'
        ],
    ],
]

Parameters

array $tools

lmsg()

lmsg(string  $key, array  $params = array()) : string

Translate message by key according to current locale

Parameters

string $key
array $params

Returns

string

getId()

getId() : string

Get unique list identifier

Returns

string