PHP 클래스 Grid_Advanced, atk4

상속: extends Grid_Basic
파일 보기 프로젝트 열기: atk4/atk4 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
$_url
$data Static data source?
$js_widget JavaScript widget
$js_widget_arguments
$paginator Paginator Paginator object.
$paginator_class string Paginator class name.
$quick_search QuickSearch QuickSearch object.
$quick_search_class string QuickSearch class name.
$sortby Sorting
$sortby_db

보호된 프로퍼티들

프로퍼티 타입 설명
$tdparam array This should be a hash: 'param_name'=>'param_value' Following parameters treated and processed in a special way: 1) 'style': nested array, style parameter. items of this nested array converted to a form of style: style="param_name: param_value; param_name: param_value". All the rest are not checked and simply converted to a form of param_name="param_value" This is a tree-like array with the following structure: array( [level1] => dataset_row = array( [level2] => field = array( [level3] => tdparam_elements = array( param_name => param_value ) ) ) )

공개 메소드들

메소드 설명
_performDelete ( string $id ) Delete record from DB.
addOrder ( ) : Order Adds column ordering object.
addPaginator ( integer $rows = 25, array $options = null, string $class = null ) : Paginator Adds paginator to the grid.
addQuickSearch ( array $fields, array $options = null, string $class = null, string $spot = null ) : QuickSearch Adds QuickSearch to the grid.
addSelectable ( mixed $field ) Adds column with checkboxes on the basis of Model definition.
applySorting ( Iterator $i, string $field, string | boolean $desc ) Apply sorting on particular field.
applyTDParams ( string $field, SQLite &$row_template = null ) Apply TD parameters to appropriate template.
enablePaginator ( integer $rows = 25, array $options = null ) Add default paginator to the grid.
enableQuickSearch ( array $fields, array $options = null ) Adds default QuickSearch to the grid.
formatTotalsRow ( ) Additional formatting for Totals row.
format_boolean ( string $field ) Format field as boolean.
format_button ( string $field ) Format field as button.
format_checkbox ( string $field ) Format field as checkbox.
format_confirm ( string $field ) Format field as confirm button.
format_date ( string $field ) Format field as date.
format_datetime ( string $field ) Format field as datetime.
format_delete ( string $field ) Format field as delete button.
format_expander ( string $field, array $column ) Format expander.
format_float ( string $field ) Format field as real number with 2 digit precision.
format_fullwidth ( string $field ) Format field as full width field.
format_html ( string $field ) Format field as HTML without encoding. Use with care.
format_image ( string $field ) Format field as HTML image tag.
format_link ( string $field ) Format field as link.
format_money ( string $field ) Format field as money with 2 digit precision.
format_nl2br ( string $field ) Format field as New-Line to BR-eak.
format_nowrap ( string $field ) Format field as no-wrap field.
format_number ( string $field ) Format field as number.
format_object ( string $field ) Format field as object.
format_password ( string $field ) Format password field.
format_prompt ( string $field ) Format field as prompt button.
format_real ( $field )
format_shorttext ( string $field ) Format shorttext field.
format_template ( string $field ) Format field using template.
format_time ( string $field ) Format field as time.
format_timestamp ( string $field ) Format field as timestamp.
format_totals_checkbox ( string $field, array $column ) Additional formatting of checkbox fields column for totals row.
format_totals_delete ( string $field, array $column ) Additional formatting of delete button fields for totals row.
format_totals_expander ( string $field, array $column ) Additional formatting of expander fields for totals row.
format_totals_money ( string $field ) Additional formatting of money fields for totals row.
format_totals_number ( string $field ) Additional formatting of number fields for totals row.
format_totals_real ( string $field ) Additional formatting of real number fields for totals row.
format_totals_template ( string $field, array $column ) Additional formatting of custom template fields for totals row.
format_wrap ( string $field ) Format field as wrap field.
getCurrentIndex ( string $idfield = 'id' ) : mixed Returns ID of record.
getIterator ( ) : mixed Returns data source iterator.
init ( ) Initialization.
init_boolean ( string $field ) Initialize column as boolean.
init_button ( string $field ) Initialize buttons column.
init_confirm ( string $field ) Initialize confirm buttons column.
init_delete ( string $field ) Initialize column with delete buttons.
init_expander ( string $field ) Initialize expander.
init_float ( string $field ) Initialize column as real number.
init_fullwidth ( string $field ) Initialize column as fullwidth.
init_link ( string $field ) Initialize column with links using template.
init_money ( string $field ) Initialize column as money.
init_prompt ( string $field ) Initialize prompt buttons column.
init_real ( $field )
makeSortable ( string $db_sort = null ) Make sortable.
render ( ) Render grid.
renderTotalsRow ( ) Render Totals row.
setTDParam ( string $field, string $path, string $value ) Sets TD params.
setTemplate ( string $template, $field = null ) This allows you to use Template.
setTotalsTitle ( string $field, string $title = 'Total: %s row%s' ) Sets totals title field and text.
staticSortCompare ( string $str1, string $str2 ) : integer Compare two strings and return: < 0 if str1 is less than str2; > 0 if str1 is greater than str2, and 0 if they are equal.
updateGrandTotals ( ) Calculate grand totals of all rows.
updateTotals ( ) Add current rendered row values to totals.

메소드 상세

_performDelete() 공개 메소드

Formatter init_delete() calls this to delete current record from DB
public _performDelete ( string $id )
$id string ID of record

addOrder() 공개 메소드

With it you can reorder your columns
public addOrder ( ) : Order
리턴 Order

addPaginator() 공개 메소드

Adds paginator to the grid.
public addPaginator ( integer $rows = 25, array $options = null, string $class = null ) : Paginator
$rows integer row count per page
$options array optional options array
$class string optional paginator class name
리턴 Paginator

addQuickSearch() 공개 메소드

Adds QuickSearch to the grid.
public addQuickSearch ( array $fields, array $options = null, string $class = null, string $spot = null ) : QuickSearch
$fields array array of fieldnames used in quick search
$options array optional options array
$class string optional quick search object class
$spot string optional template spot
리턴 QuickSearch

addSelectable() 공개 메소드

Adds column with checkboxes on the basis of Model definition.
public addSelectable ( mixed $field )
$field mixed should be Form_Field object or jQuery selector of 1 field. When passing it as jQuery selector don't forget to use hash sign like "#myfield"

applySorting() 공개 메소드

Apply sorting on particular field.
public applySorting ( Iterator $i, string $field, string | boolean $desc )
$i Iterator
$field string
$desc string | boolean

applyTDParams() 공개 메소드

You can pass row template to use too. That's useful to set up totals rows, for example.
public applyTDParams ( string $field, SQLite &$row_template = null )
$field string Fieldname
$row_template SQLite Optional row template

enablePaginator() 공개 메소드

Add default paginator to the grid.
public enablePaginator ( integer $rows = 25, array $options = null )
$rows integer row count per page
$options array optional options array

enableQuickSearch() 공개 메소드

Adds default QuickSearch to the grid.
public enableQuickSearch ( array $fields, array $options = null )
$fields array array of fieldnames used in quick search
$options array optional options array

formatTotalsRow() 공개 메소드

Extends CompleteLister formatTotalsRow method. Note: in this method you should only add *additional* formatting of totals row because standard row formatting will be already applied by calling parent::formatTotalsRow().
public formatTotalsRow ( )

format_boolean() 공개 메소드

Format field as boolean.
public format_boolean ( string $field )
$field string

format_button() 공개 메소드

Format field as button.
public format_button ( string $field )
$field string

format_checkbox() 공개 메소드

Format field as checkbox.
public format_checkbox ( string $field )
$field string

format_confirm() 공개 메소드

Format field as confirm button.
public format_confirm ( string $field )
$field string

format_date() 공개 메소드

Format field as date.
public format_date ( string $field )
$field string

format_datetime() 공개 메소드

Format field as datetime.
public format_datetime ( string $field )
$field string

format_delete() 공개 메소드

Format field as delete button.
public format_delete ( string $field )
$field string

format_expander() 공개 메소드

Format expander.
public format_expander ( string $field, array $column )
$field string field name
$column array column configuration

format_float() 공개 메소드

Format field as real number with 2 digit precision.
public format_float ( string $field )
$field string

format_fullwidth() 공개 메소드

Format field as full width field.
public format_fullwidth ( string $field )
$field string

format_html() 공개 메소드

Format field as HTML without encoding. Use with care.
public format_html ( string $field )
$field string

format_image() 공개 메소드

Format field as HTML image tag.
public format_image ( string $field )
$field string

format_money() 공개 메소드

Format field as money with 2 digit precision.
public format_money ( string $field )
$field string

format_nl2br() 공개 메소드

Format field as New-Line to BR-eak.
public format_nl2br ( string $field )
$field string

format_nowrap() 공개 메소드

Format field as no-wrap field.
public format_nowrap ( string $field )
$field string

format_number() 공개 메소드

Format field as number.
public format_number ( string $field )
$field string

format_object() 공개 메소드

Format field as object.
public format_object ( string $field )
$field string

format_password() 공개 메소드

Format password field.
public format_password ( string $field )
$field string

format_prompt() 공개 메소드

Format field as prompt button.
public format_prompt ( string $field )
$field string

format_real() 공개 메소드

public format_real ( $field )

format_shorttext() 공개 메소드

Format shorttext field.
public format_shorttext ( string $field )
$field string

format_template() 공개 메소드

Format field using template.
public format_template ( string $field )
$field string

format_time() 공개 메소드

Format field as time.
public format_time ( string $field )
$field string

format_timestamp() 공개 메소드

Format field as timestamp.
public format_timestamp ( string $field )
$field string

format_totals_checkbox() 공개 메소드

Basically we remove everything from such field
public format_totals_checkbox ( string $field, array $column )
$field string field name
$column array column configuration

format_totals_delete() 공개 메소드

Basically we remove everything from such field
public format_totals_delete ( string $field, array $column )
$field string field name
$column array column configuration

format_totals_expander() 공개 메소드

Basically we remove everything from such field
public format_totals_expander ( string $field, array $column )
$field string field name
$column array column configuration

format_totals_money() 공개 메소드

Additional formatting of money fields for totals row.
public format_totals_money ( string $field )
$field string

format_totals_number() 공개 메소드

Additional formatting of number fields for totals row.
public format_totals_number ( string $field )
$field string

format_totals_real() 공개 메소드

Additional formatting of real number fields for totals row.
public format_totals_real ( string $field )
$field string

format_totals_template() 공개 메소드

Basically we remove everything from such field
public format_totals_template ( string $field, array $column )
$field string field name
$column array column configuration

format_wrap() 공개 메소드

Format field as wrap field.
public format_wrap ( string $field )
$field string

getCurrentIndex() 공개 메소드

Returns ID of record.
public getCurrentIndex ( string $idfield = 'id' ) : mixed
$idfield string ID field name
리턴 mixed

getIterator() 공개 메소드

Returns data source iterator.
public getIterator ( ) : mixed
리턴 mixed

init() 공개 메소드

Initialization.
public init ( )

init_boolean() 공개 메소드

Initialize column as boolean.
public init_boolean ( string $field )
$field string

init_button() 공개 메소드

Initialize buttons column.
public init_button ( string $field )
$field string

init_confirm() 공개 메소드

Initialize confirm buttons column.
public init_confirm ( string $field )
$field string

init_delete() 공개 메소드

Initialize column with delete buttons.
public init_delete ( string $field )
$field string

init_expander() 공개 메소드

Initialize expander.
public init_expander ( string $field )
$field string field name

init_float() 공개 메소드

Initialize column as real number.
public init_float ( string $field )
$field string

init_fullwidth() 공개 메소드

Initialize column as fullwidth.
public init_fullwidth ( string $field )
$field string

init_money() 공개 메소드

Initialize column as money.
public init_money ( string $field )
$field string

init_prompt() 공개 메소드

Initialize prompt buttons column.
public init_prompt ( string $field )
$field string

init_real() 공개 메소드

public init_real ( $field )

makeSortable() 공개 메소드

Make sortable.
public makeSortable ( string $db_sort = null )
$db_sort string

render() 공개 메소드

Render grid.
public render ( )

renderTotalsRow() 공개 메소드

Render Totals row.
public renderTotalsRow ( )

setTDParam() 공개 메소드

Sets TD params.
public setTDParam ( string $field, string $path, string $value )
$field string
$path string
$value string

setTemplate() 공개 메소드

This allows you to use Template.
public setTemplate ( string $template, $field = null )
$template string template as a string

setTotalsTitle() 공개 메소드

Sets totals title field and text.
public setTotalsTitle ( string $field, string $title = 'Total: %s row%s' )
$field string
$title string

staticSortCompare() 공개 메소드

Note that this comparison is case sensitive
public staticSortCompare ( string $str1, string $str2 ) : integer
$str1 string
$str2 string
리턴 integer

updateGrandTotals() 공개 메소드

Called one time on rendering phase - before renderRows() call.
public updateGrandTotals ( )

updateTotals() 공개 메소드

Called before each formatRow() call.
public updateTotals ( )

프로퍼티 상세

$_url 공개적으로 프로퍼티

public $_url

$data 공개적으로 프로퍼티

Static data source?
public $data

$js_widget 공개적으로 프로퍼티

JavaScript widget
public $js_widget

$js_widget_arguments 공개적으로 프로퍼티

public $js_widget_arguments

$paginator 공개적으로 프로퍼티

Paginator object.
또한 보기: addPaginator()
public Paginator $paginator
리턴 Paginator

$paginator_class 공개적으로 프로퍼티

Paginator class name.
또한 보기: enablePaginator()
public string $paginator_class
리턴 string

$quick_search_class 공개적으로 프로퍼티

QuickSearch class name.
또한 보기: enableQuickSearch()
public string $quick_search_class
리턴 string

$sortby 공개적으로 프로퍼티

Sorting
public $sortby

$sortby_db 공개적으로 프로퍼티

public $sortby_db

$tdparam 보호되어 있는 프로퍼티

This should be a hash: 'param_name'=>'param_value' Following parameters treated and processed in a special way: 1) 'style': nested array, style parameter. items of this nested array converted to a form of style: style="param_name: param_value; param_name: param_value". All the rest are not checked and simply converted to a form of param_name="param_value" This is a tree-like array with the following structure: array( [level1] => dataset_row = array( [level2] => field = array( [level3] => tdparam_elements = array( param_name => param_value ) ) ) )
protected array $tdparam
리턴 array