PHP Class GridFieldSortableRows

Inheritance: implements GridField_HTMLProvider, implements GridField_ActionProvider, implements GridField_DataManipulator
Afficher le fichier Open project: undefinedoffset/sortablegridfield Class Usage Examples

Protected Properties

Свойство Type Description
$append_to_top
$custom_relation_name
$disable_selection
$sortColumn
$update_versioned_stage

Méthodes publiques

Méthode 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

Méthodes protégées

Méthode 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 méthode

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 méthode

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 méthode

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

getHTMLFragments() public méthode

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
Résultat Array Map where the keys are fragment names and the values are pieces of HTML to add to these fragments.

getManipulatedData() public méthode

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
Résultat DataList Modified Data List

handleAction() public méthode

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 méthode

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 méthode

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
Résultat GridFieldSortableRows Returns the current instance

setCustomRelationName() public méthode

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
Résultat GridFieldSortableRows Returns the current instance

setDisableSelection() public méthode

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

setUpdateVersionedStage() public méthode

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
Résultat GridFieldSortableRows Returns the current instance

sortToPage() protected méthode

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