PHP Class GridFieldSortableRows

Inheritance: implements GridField_HTMLProvider, implements GridField_ActionProvider, implements GridField_DataManipulator
Mostra file Open project: undefinedoffset/sortablegridfield Class Usage Examples

Protected Properties

Property Type Description
$append_to_top
$custom_relation_name
$disable_selection
$sortColumn
$update_versioned_stage

Public Methods

Method Description
__construct ( string $sortColumn, boolean $disableSelection = true, string $updateVersionStage = null, string $customRelationName = null )
getActions ( GridField $gridField ) : Array Return a list of the actions handled by this action provider.
getHTMLFragments ( GridField $gridField ) : Array Returns a map where the keys are fragment names and the values are pieces of HTML to add to these fragments.
getManipulatedData ( GridField $gridField, SS_List $dataList ) : DataList Manipulate the datalist as needed by this grid modifier.
handleAction ( GridField $gridField, String $actionName, Array $arguments, Array $data ) Handle an action on the given grid field.
setAppendToTop ( boolean $value ) : GridFieldSortableRows Sets if new records should be appended to the top or the bottom of the list
setCustomRelationName ( string $value ) : GridFieldSortableRows Sets the name of the relationship to use, by default the name is determined from the GridField's name
setDisableSelection ( boolean $value ) : GridFieldSortableRows
setUpdateVersionedStage ( string $value ) : GridFieldSortableRows Sets the suffix of the versioned stage that should be updated along side the default stage

Protected Methods

Method Description
fixSortColumn ( GridField $gridField, SS_List $dataList ) Detects and corrects items with a sort column value of 0, by appending them to the bottom of the list
saveGridRowSort ( GridField $gridField, Array $data ) Handles saving of the row sort order
sortToPage ( GridField $gridField, Array $data ) Handles sorting across pages

Method Details

__construct() public method

public __construct ( string $sortColumn, boolean $disableSelection = true, string $updateVersionStage = null, string $customRelationName = null )
$sortColumn string Column that should be used to update the sort information
$disableSelection boolean Disable selection on the GridField when dragging
$updateVersionStage string Name of the versioned stage to update this disabled by default unless this is set
$customRelationName string Name of the relationship to use, if left null the name is determined from the GridField's name

fixSortColumn() protected method

Detects and corrects items with a sort column value of 0, by appending them to the bottom of the list
protected fixSortColumn ( GridField $gridField, SS_List $dataList )
$gridField GridField Grid Field Reference
$dataList SS_List Data List of items to be checked

getActions() public method

Return a list of the actions handled by this action provider.
public getActions ( GridField $gridField ) : Array
$gridField GridField Grid Field Reference
return Array Array with action identifier strings.

getHTMLFragments() public method

Returns a map where the keys are fragment names and the values are pieces of HTML to add to these fragments.
public getHTMLFragments ( GridField $gridField ) : Array
$gridField GridField Grid Field Reference
return Array Map where the keys are fragment names and the values are pieces of HTML to add to these fragments.

getManipulatedData() public method

Manipulate the datalist as needed by this grid modifier.
public getManipulatedData ( GridField $gridField, SS_List $dataList ) : DataList
$gridField GridField Grid Field Reference
$dataList SS_List Data List to adjust
return DataList Modified Data List

handleAction() public method

Handle an action on the given grid field.
public handleAction ( GridField $gridField, String $actionName, Array $arguments, Array $data )
$gridField GridField Grid Field Reference
$actionName String Action identifier, see {@link getActions()}.
$arguments Array Arguments relevant for this
$data Array All form data

saveGridRowSort() protected method

Handles saving of the row sort order
protected saveGridRowSort ( GridField $gridField, Array $data )
$gridField GridField Grid Field Reference
$data Array Data submitted in the request

setAppendToTop() public method

Sets if new records should be appended to the top or the bottom of the list
public setAppendToTop ( boolean $value ) : GridFieldSortableRows
$value boolean Boolean true to append to the top false to append to the bottom
return GridFieldSortableRows Returns the current instance

setCustomRelationName() public method

Sets the name of the relationship to use, by default the name is determined from the GridField's name
public setCustomRelationName ( string $value ) : GridFieldSortableRows
$value string Name of the relationship to use, by default the name is determined from the GridField's name
return GridFieldSortableRows Returns the current instance

setDisableSelection() public method

public setDisableSelection ( boolean $value ) : GridFieldSortableRows
$value boolean Boolean true to disable selection of table contents false to enable selection
return GridFieldSortableRows Returns the current instance

setUpdateVersionedStage() public method

Sets the suffix of the versioned stage that should be updated along side the default stage
public setUpdateVersionedStage ( string $value ) : GridFieldSortableRows
$value string Versioned Stage to update this is disabled by default unless this is set
return GridFieldSortableRows Returns the current instance

sortToPage() protected method

Handles sorting across pages
protected sortToPage ( GridField $gridField, Array $data )
$gridField GridField Grid Field Reference
$data Array Data submitted in the request

Property Details

$append_to_top protected_oe property

protected $append_to_top

$custom_relation_name protected_oe property

protected $custom_relation_name

$disable_selection protected_oe property

protected $disable_selection

$sortColumn protected_oe property

protected $sortColumn

$update_versioned_stage protected_oe property

protected $update_versioned_stage