PHP 클래스 GridFieldOrderableRows, silverstripe-gridfieldextensions

If the grid field has not been sorted, this component will sort the data by the sort field.
상속: extends RequestHandler, implements GridField_ColumnProvider, implements GridField_DataManipulator, implements GridField_HTMLProvider, implements GridField_URLHandler
파일 보기 프로젝트 열기: ajshort/silverstripe-gridfieldextensions 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$extraSortFields string | array Extra sort fields to apply before the sort field.
$immediateUpdate boolean If set to true, when an item is re-ordered, it will update on the database and refresh the gridfield. When set to false, it will only update the sort order when the record is saved.
$reorderColumnNumber integer The number of the column containing the reorder handles
$sortField string The database field which specifies the sort, defaults to "Sort".

공개 메소드들

메소드 설명
__construct ( string $sortField = 'Sort' )
augmentColumns ( $grid, &$cols )
getColumnAttributes ( $grid, $record, $col )
getColumnContent ( $grid, $record, $col )
getColumnMetadata ( $grid, $col )
getColumnsHandled ( $grid )
getExtraSortFields ( ) : string | array
getHTMLFragments ( GridField $field )
getImmediateUpdate ( ) : boolean
getManipulatedData ( GridField $grid, SS_List $list )
getReorderColumnNumber ( ) : integer
getSortField ( ) : string
getSortTable ( SS_List $list ) : string Gets the table which contains the sort field.
getURLHandlers ( $grid )
handleMoveToPage ( GridField $grid, $request ) Handles requests to move an item to the previous or next page.
handleReorder ( GridField $grid, SS_HTTPRequest $request ) : SS_HTTPResponse Handles requests to reorder a set of IDs in a specific order.
handleSave ( GridField $grid, DataObjectInterface $record ) Handle saving when 'immediateUpdate' is disabled, otherwise this isn't necessary for the default sort mode.
setExtraSortFields ( string | array $fields ) : GridFieldOrderableRows Sets extra sort fields to apply before the sort field.
setImmediateUpdate ( $bool ) : GridFieldOrderableRows
setReorderColumnNumber ( integer $colno ) : GridFieldOrderableRows Sets the number of the column containing the reorder handles.
setSortField ( $field ) : GridFieldOrderableRows Sets the field used to specify the sort.

보호된 메소드들

메소드 설명
executeReorder ( GridField $grid, array $sortedIDs ) : boolean
getSortTableClauseForIds ( DataList $list, $ids )
getSortedIDs ( array $data ) : array Get mapping of sort value to ID from posted data
populateSortValues ( DataList $list )
reorderItems ( $list, array $values, array $sortedIDs )

메소드 상세

__construct() 공개 메소드

public __construct ( string $sortField = 'Sort' )
$sortField string

augmentColumns() 공개 메소드

public augmentColumns ( $grid, &$cols )

executeReorder() 보호된 메소드

protected executeReorder ( GridField $grid, array $sortedIDs ) : boolean
$grid GridField
$sortedIDs array List of IDS, where the key is the sort field value to save
리턴 boolean

getColumnAttributes() 공개 메소드

public getColumnAttributes ( $grid, $record, $col )

getColumnContent() 공개 메소드

public getColumnContent ( $grid, $record, $col )

getColumnMetadata() 공개 메소드

public getColumnMetadata ( $grid, $col )

getColumnsHandled() 공개 메소드

public getColumnsHandled ( $grid )

getExtraSortFields() 공개 메소드

public getExtraSortFields ( ) : string | array
리턴 string | array

getHTMLFragments() 공개 메소드

public getHTMLFragments ( GridField $field )
$field GridField

getImmediateUpdate() 공개 메소드

public getImmediateUpdate ( ) : boolean
리턴 boolean

getManipulatedData() 공개 메소드

public getManipulatedData ( GridField $grid, SS_List $list )
$grid GridField
$list SS_List

getReorderColumnNumber() 공개 메소드

public getReorderColumnNumber ( ) : integer
리턴 integer

getSortField() 공개 메소드

public getSortField ( ) : string
리턴 string

getSortTable() 공개 메소드

Gets the table which contains the sort field.
public getSortTable ( SS_List $list ) : string
$list SS_List
리턴 string

getSortTableClauseForIds() 보호된 메소드

protected getSortTableClauseForIds ( DataList $list, $ids )
$list DataList

getSortedIDs() 보호된 메소드

Get mapping of sort value to ID from posted data
protected getSortedIDs ( array $data ) : array
$data array Raw posted data
리턴 array

getURLHandlers() 공개 메소드

public getURLHandlers ( $grid )

handleMoveToPage() 공개 메소드

Handles requests to move an item to the previous or next page.
public handleMoveToPage ( GridField $grid, $request )
$grid GridField

handleReorder() 공개 메소드

Handles requests to reorder a set of IDs in a specific order.
public handleReorder ( GridField $grid, SS_HTTPRequest $request ) : SS_HTTPResponse
$grid GridField
$request SS_HTTPRequest
리턴 SS_HTTPResponse

handleSave() 공개 메소드

Handle saving when 'immediateUpdate' is disabled, otherwise this isn't necessary for the default sort mode.
public handleSave ( GridField $grid, DataObjectInterface $record )
$grid GridField
$record DataObjectInterface

populateSortValues() 보호된 메소드

protected populateSortValues ( DataList $list )
$list DataList

reorderItems() 보호된 메소드

protected reorderItems ( $list, array $values, array $sortedIDs )
$values array
$sortedIDs array

setExtraSortFields() 공개 메소드

Sets extra sort fields to apply before the sort field.
public setExtraSortFields ( string | array $fields ) : GridFieldOrderableRows
$fields string | array
리턴 GridFieldOrderableRows $this

setImmediateUpdate() 공개 메소드

public setImmediateUpdate ( $bool ) : GridFieldOrderableRows
리턴 GridFieldOrderableRows $this

setReorderColumnNumber() 공개 메소드

Sets the number of the column containing the reorder handles.
public setReorderColumnNumber ( integer $colno ) : GridFieldOrderableRows
$colno integer
리턴 GridFieldOrderableRows $this

setSortField() 공개 메소드

Sets the field used to specify the sort.
public setSortField ( $field ) : GridFieldOrderableRows
리턴 GridFieldOrderableRows $this

프로퍼티 상세

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

Extra sort fields to apply before the sort field.
또한 보기: setExtraSortFields()
protected string|array $extraSortFields
리턴 string | array

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

If set to true, when an item is re-ordered, it will update on the database and refresh the gridfield. When set to false, it will only update the sort order when the record is saved.
protected bool $immediateUpdate
리턴 boolean

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

The number of the column containing the reorder handles
또한 보기: setReorderColumnNumber()
protected int $reorderColumnNumber
리턴 integer

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

The database field which specifies the sort, defaults to "Sort".
또한 보기: setSortField()
protected string $sortField
리턴 string