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
파일 보기 프로젝트 열기: yinhe/yincart

공개 프로퍼티들

프로퍼티 타입 설명
$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