GridFieldSortableRows
class GridFieldSortableRows extends AbstractGridFieldComponent implements GridField_HTMLProvider, GridField_ActionProvider, GridField_DataManipulator (View source)
This component provides a checkbox which when checked enables drag-and-drop re-ordering of elements displayed in a GridField
Traits
A class that can be instantiated or replaced via DI
Properties
protected | string | $sortColumn | ||
protected | bool | $disable_selection | ||
protected | bool | $append_to_top | ||
protected | null|string | $update_versioned_stage | ||
protected | null|string | $custom_relation_name |
Methods
An implementation of the factory method, allows you to create an instance of a class
Creates a class instance by the "singleton" design pattern.
No description
Returns a map where the keys are fragment names and the values are pieces of HTML to add to these fragments.
Manipulate the datalist as needed by this grid modifier.
Sets if new records should be appended to the top or the bottom of the list
Sets the suffix of the versioned stage that should be updated along side the default stage
Sets the name of the relationship to use, by default the name is determined from the GridField's name
Detects and corrects items with a sort column value of 0, by appending them to the bottom of the list
Handle an action on the given grid field.
Check to see if the given class name has the Versioned extension
Checks to see if $table_name is declared on the DataObject, if not returns string as given
Details
static Injectable
create(mixed ...$args)
An implementation of the factory method, allows you to create an instance of a class
This method will defer class substitution to the Injector API, which can be customised via the Config API to declare substitution classes.
This can be called in one of two ways - either calling via the class directly, or calling on Object and passing the class name as the first parameter. The following are equivalent: $list = DataList::create(SiteTree::class); $list = SiteTree::get();
static Injectable
singleton(string $class = null)
Creates a class instance by the "singleton" design pattern.
It will always return the same instance for this class, which can be used for performance reasons and as a simple way to access instance methods which don't rely on instance data (e.g. the custom SilverStripe static handling).
__construct(string $sortColumn, bool $disableSelection = true, string $updateVersionStage = null, string $customRelationName = null)
No description
array
getHTMLFragments(GridField $gridField)
Returns a map where the keys are fragment names and the values are pieces of HTML to add to these fragments.
SS_List
getManipulatedData(GridField $gridField, SS_List $dataList)
Manipulate the datalist as needed by this grid modifier.
GridFieldSortableRows
setAppendToTop(bool $value)
Sets if new records should be appended to the top or the bottom of the list
GridFieldSortableRows
setDisableSelection(bool $value)
No description
GridFieldSortableRows
setUpdateVersionedStage(string $value)
Sets the suffix of the versioned stage that should be updated along side the default stage
GridFieldSortableRows
setCustomRelationName(string $value)
Sets the name of the relationship to use, by default the name is determined from the GridField's name
protected
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
array
getActions(GridField $gridField)
Return a list of the actions handled by this action provider.
handleAction(GridField $gridField, string $actionName, array $arguments, array $data)
Handle an action on the given grid field.
protected
saveGridRowSort(GridField $gridField, array $data)
Handles saving of the row sort order
protected
sortToPage(GridField $gridField, array $data)
Handles sorting across pages
bool
hasVersionedExtension(Extensible|string $className)
Check to see if the given class name has the Versioned extension
string
mapTableNameAndReturn($className)
deprecated
deprecated
Checks to see if $table_name is declared on the DataObject, if not returns string as given