class GridFieldPaginator implements GridField_HTMLProvider, GridField_DataManipulator, GridField_ActionProvider (View source)

GridFieldPaginator paginates the GridField list and adds controls to the bottom of the GridField.

Properties

protected int $itemsPerPage
protected string $itemClass

Which template to use for rendering

protected $throwExceptionOnBadDataType

See setThrowExceptionOnBadDataType()

protected $totalItems

Methods

public
__construct(int $itemsPerPage = null)

No description

public
setThrowExceptionOnBadDataType($throwExceptionOnBadDataType)

Determine what happens when this component is used with a list that isn't SS_Filterable.

public
getThrowExceptionOnBadDataType()

See setThrowExceptionOnBadDataType()

protected
checkDataType($dataList)

Check that this dataList is of the right data type.

public
array
getActions($gridField)

No description

public
handleAction(GridField $gridField, $actionName, $arguments, $data)

No description

protected
getGridPagerState(GridField $gridField)

Retrieves/Sets up the state object used to store and retrieve information about the current paging details of this GridField

public
getManipulatedData(GridField $gridField, SS_List $dataList)

No description

public
ArrayData|null
getTemplateParameters(GridField $gridField)

Determines arguments to be passed to the template for building this field

public
array
getHTMLFragments($gridField)

No description

public
setItemsPerPage($num)

No description

public
int
getItemsPerPage()

No description

Details

__construct(int $itemsPerPage = null)

No description

Parameters

int $itemsPerPage
  • How many items should be displayed per page

setThrowExceptionOnBadDataType($throwExceptionOnBadDataType)

Determine what happens when this component is used with a list that isn't SS_Filterable.

  • true: An exception is thrown
    • false: This component will be ignored - it won't make any changes to the GridField.

By default, this is set to true so that it's clearer what's happening, but the predefined GridFieldConfig subclasses set this to false for flexibility.

Parameters

$throwExceptionOnBadDataType

getThrowExceptionOnBadDataType()

See setThrowExceptionOnBadDataType()

protected checkDataType($dataList)

Check that this dataList is of the right data type.

Returns false if it's a bad data type, and if appropriate, throws an exception.

Parameters

$dataList

array getActions($gridField)

No description

Parameters

$gridField

Return Value

array

with action identifier strings.

handleAction(GridField $gridField, $actionName, $arguments, $data)

No description

Parameters

GridField $gridField
$actionName
$arguments
$data

protected GridState_Data getGridPagerState(GridField $gridField)

Retrieves/Sets up the state object used to store and retrieve information about the current paging details of this GridField

Parameters

GridField $gridField

Return Value

GridState_Data

DataList getManipulatedData(GridField $gridField, SS_List $dataList)

No description

Parameters

GridField $gridField
SS_List $dataList

Return Value

DataList

ArrayData|null getTemplateParameters(GridField $gridField)

Determines arguments to be passed to the template for building this field

Parameters

GridField $gridField

Return Value

ArrayData|null

If paging is available this will be an ArrayData object of paging details with these parameters:

  • OnlyOnePage: boolean - Is there only one page?
  • FirstShownRecord: integer - Number of the first record displayed
  • LastShownRecord: integer - Number of the last record displayed
  • NumRecords: integer - Total number of records
  • NumPages: integer - The number of pages
  • CurrentPageNum (optional): integer - If OnlyOnePage is false, the number of the current page
  • FirstPage (optional): GridField_FormAction - Button to go to the first page
  • PreviousPage (optional): GridField_FormAction - Button to go to the previous page
  • NextPage (optional): GridField_FormAction - Button to go to the next page
  • LastPage (optional): GridField_FormAction - Button to go to last page

array getHTMLFragments($gridField)

No description

Parameters

$gridField

Return Value

array

setItemsPerPage($num)

No description

Parameters

$num

int getItemsPerPage()

No description

Return Value

int