class GridFieldPaginator implements GridField_HTMLProvider, GridField_DataManipulator, GridField_ActionProvider

GridFieldPaginator paginates the {@link GridField} list and adds controls to the bottom of the {@link GridField}.

Config options

default_items_per_page int Specifies default items per page

Methods

__construct(int $itemsPerPage = null)

No description

setThrowExceptionOnBadDataType($throwExceptionOnBadDataType)

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

getThrowExceptionOnBadDataType()

See {@link setThrowExceptionOnBadDataType()}

Array
getActions(GridField $gridField)

No description

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

No description

getManipulatedData(GridField $gridField, SS_List $dataList)

No description

ArrayData|null
getTemplateParameters(GridField $gridField)

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

array
getHTMLFragments($gridField)

No description

setItemsPerPage(Int $num)

No description

Int
getItemsPerPage()

No description

Details

at line 40
__construct(int $itemsPerPage = null)

Parameters

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

at line 54
setThrowExceptionOnBadDataType($throwExceptionOnBadDataType)

Determine what happens when this component is used with a list that isn't {@link 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 {@link GridFieldConfig} subclasses set this to false for flexibility.

Parameters

$throwExceptionOnBadDataType

at line 61
getThrowExceptionOnBadDataType()

See {@link setThrowExceptionOnBadDataType()}

at line 86
Array getActions(GridField $gridField)

Parameters

GridField $gridField

Return Value

Array with action identifier strings.

at line 100
handleAction(GridField $gridField, String $actionName, Array $arguments, Array $data)

Parameters

GridField $gridField
String $actionName Action identifier, see {@link getActions()}.
Array $arguments Arguments relevant for this
Array $data All form data

at line 133
DataList getManipulatedData(GridField $gridField, SS_List $dataList)

Parameters

GridField $gridField
SS_List $dataList

Return Value

DataList

at line 173
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

at line 261
array getHTMLFragments($gridField)

Parameters

$gridField

Return Value

array

at line 275
setItemsPerPage(Int $num)

Parameters

Int $num

at line 283
Int getItemsPerPage()

Return Value

Int