Property | Type | Description | |
---|---|---|---|
$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". |
Method | Description | |
---|---|---|
__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. |
Method | Description | |
---|---|---|
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 ) |
protected executeReorder ( GridField $grid, array $sortedIDs ) : boolean | ||
$grid | GridField | |
$sortedIDs | array | List of IDS, where the key is the sort field value to save |
return | boolean |
public getExtraSortFields ( ) : string | array | ||
return | string | array |
public getManipulatedData ( GridField $grid, SS_List $list ) | ||
$grid | GridField | |
$list | SS_List |
public getSortTable ( SS_List $list ) : string | ||
$list | SS_List | |
return | string |
protected getSortTableClauseForIds ( DataList $list, $ids ) | ||
$list | DataList |
protected getSortedIDs ( array $data ) : array | ||
$data | array | Raw posted data |
return | array |
public handleMoveToPage ( GridField $grid, $request ) | ||
$grid | GridField |
public handleReorder ( GridField $grid, SS_HTTPRequest $request ) : SS_HTTPResponse | ||
$grid | GridField | |
$request | SS_HTTPRequest | |
return | SS_HTTPResponse |
public handleSave ( GridField $grid, DataObjectInterface $record ) | ||
$grid | GridField | |
$record | DataObjectInterface |
protected populateSortValues ( DataList $list ) | ||
$list | DataList |
protected reorderItems ( $list, array $values, array $sortedIDs ) | ||
$values | array | |
$sortedIDs | array |
public setExtraSortFields ( string | array $fields ) : GridFieldOrderableRows | ||
$fields | string | array | |
return | GridFieldOrderableRows | $this |
public setImmediateUpdate ( $bool ) : GridFieldOrderableRows | ||
return | GridFieldOrderableRows | $this |
public setReorderColumnNumber ( integer $colno ) : GridFieldOrderableRows | ||
$colno | integer | |
return | GridFieldOrderableRows | $this |
public setSortField ( $field ) : GridFieldOrderableRows | ||
return | GridFieldOrderableRows | $this |
protected bool $immediateUpdate | ||
return | boolean |
protected int $reorderColumnNumber | ||
return | integer |
protected string $sortField | ||
return | string |