PHP Класс TbJsonGridView

Converts TbGridView into a Json Javascript grid when using AJAX updates calls. This grid makes use of localStorage or a custom in memory plugin to avoid repetitive ajax requests/responses and speed up data visualization.
Наследование: extends TbGridView
Показать файл Открыть проект

Открытые свойства

Свойство Тип Описание
$cacheTTL integer how long we keep the responses on cache? It will depend on cacheTTLType (seconds, minutes, hours)
$cacheTTLType the type of cache duration s: seconds m: minutes h: hours
$json boolean true when there is an AJAX request. TbJsonGridView expect a JSON response.
$localCache boolean whether we use client ajax cache or not. True by default.
$pager the configuration for the pager. Defaults to array('class'=>'ext.bootstrap.widgets.TbPager').
$template string Overridden standard template to add second pager on top.

Открытые методы

Метод Описание
init ( ) Initializes $json property to find out whether ajax request or not
registerClientScript ( ) Registers necessary client scripts.
renderItems ( ) Renders the data items for the grid view.
renderPager ( ) Renders the pager.
renderTableBody ( ) Renders the table body.
renderTableRow ( integer $row ) Renders a table body row.
renderTemplate ( string $id, string $text ) : string Encloses the given JavaScript within a script tag.
run ( ) Renders the view.

Защищенные методы

Метод Описание
createDataColumn ( mixed $text ) : TbJSONDataColumn | TbDataColumn | CDataColumn Creates a column based on a shortcut column specification string.
initColumns ( ) Creates column objects and initializes them.
renderTableBodyJSON ( integer $rows ) : array Renders the body table for JSON requests - assumed ajax is for JSON
renderTableRowJSON ( integer $row ) : array Renders a table body row for JSON requests - assumed ajax is for JSON
renderTemplates ( ) Renders the required templates for the client engine (jqote2 used)

Описание методов

createDataColumn() защищенный Метод

Creates a column based on a shortcut column specification string.
protected createDataColumn ( mixed $text ) : TbJSONDataColumn | TbDataColumn | CDataColumn
$text mixed the column specification string
Результат TbJSONDataColumn | TbDataColumn | CDataColumn the column instance

init() публичный Метод

Initializes $json property to find out whether ajax request or not
public init ( )

initColumns() защищенный Метод

Creates column objects and initializes them.
protected initColumns ( )

registerClientScript() публичный Метод

Registers necessary client scripts.

renderItems() публичный Метод

Renders the data items for the grid view.
public renderItems ( )

renderPager() публичный Метод

Renders the pager.
public renderPager ( )

renderTableBody() публичный Метод

Renders the table body.
public renderTableBody ( )

renderTableBodyJSON() защищенный Метод

Renders the body table for JSON requests - assumed ajax is for JSON
protected renderTableBodyJSON ( integer $rows ) : array
$rows integer
Результат array

renderTableRow() публичный Метод

Renders a table body row.
public renderTableRow ( integer $row )
$row integer the row number (zero-based).

renderTableRowJSON() защищенный Метод

Renders a table body row for JSON requests - assumed ajax is for JSON
protected renderTableRowJSON ( integer $row ) : array
$row integer
Результат array

renderTemplate() публичный Метод

Encloses the given JavaScript within a script tag.
public renderTemplate ( string $id, string $text ) : string
$id string
$text string the JavaScript to be enclosed
Результат string the enclosed JavaScript

renderTemplates() защищенный Метод

Renders the required templates for the client engine (jqote2 used)
protected renderTemplates ( )

run() публичный Метод

This is the main entry of the whole view rendering. Child classes should mainly override {@link renderContent} method.
public run ( )

Описание свойств

$cacheTTL публичное свойство

how long we keep the responses on cache? It will depend on cacheTTLType (seconds, minutes, hours)
public int $cacheTTL
Результат integer

$cacheTTLType публичное свойство

the type of cache duration s: seconds m: minutes h: hours
public $cacheTTLType

$json публичное свойство

true when there is an AJAX request. TbJsonGridView expect a JSON response.
public bool $json
Результат boolean

$localCache публичное свойство

whether we use client ajax cache or not. True by default.
public bool $localCache
Результат boolean

$pager публичное свойство

the configuration for the pager. Defaults to array('class'=>'ext.bootstrap.widgets.TbPager').
public $pager

$template публичное свойство

Overridden standard template to add second pager on top.
public string $template
Результат string