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}.

Traits

Provides extensions to this object to integrate it with standard config API methods.

Config options

default_items_per_page int Specifies default items per page

Methods

static Config_ForClass
config()

Get a configuration accessor for this class. Short hand for Config::inst()->get($this->class, .

mixed
stat(string $name) deprecated

Get inherited config value

mixed
uninherited(string $name)

Gets the uninherited value for the given config option

$this
set_stat(string $name, mixed $value) deprecated

Update the config value for a given property

__construct(int $itemsPerPage = null)

No description

$this
setThrowExceptionOnBadDataType(bool $throwExceptionOnBadDataType)

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

bool
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

getTemplateParameters(GridField $gridField)

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

array
getHTMLFragments(GridField $gridField)

No description

$this
setItemsPerPage(int $num)

No description

Int
getItemsPerPage()

No description

Details

in Configurable at line 20
static Config_ForClass config()

Get a configuration accessor for this class. Short hand for Config::inst()->get($this->class, .

....).

Return Value

Config_ForClass

in Configurable at line 32
mixed stat(string $name) deprecated

deprecated 5.0 Use ->config()->get() instead

Get inherited config value

Parameters

string $name

Return Value

mixed

in Configurable at line 44
mixed uninherited(string $name)

Gets the uninherited value for the given config option

Parameters

string $name

Return Value

mixed

in Configurable at line 57
$this set_stat(string $name, mixed $value) deprecated

deprecated 5.0 Use ->config()->set() instead

Update the config value for a given property

Parameters

string $name
mixed $value

Return Value

$this

at line 43
__construct(int $itemsPerPage = null)

Parameters

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

at line 61
$this setThrowExceptionOnBadDataType(bool $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

bool $throwExceptionOnBadDataType

Return Value

$this

at line 72
bool getThrowExceptionOnBadDataType()

See {@link setThrowExceptionOnBadDataType()}

Return Value

bool

at line 103
array getActions(GridField $gridField)

Parameters

GridField $gridField

Return Value

array with action identifier strings.

at line 120
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 158
SS_List getManipulatedData(GridField $gridField, SS_List $dataList)

Parameters

GridField $gridField
SS_List $dataList

Return Value

SS_List

at line 203
ArrayData getTemplateParameters(GridField $gridField)

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

Parameters

GridField $gridField

Return Value

ArrayData 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 310
array getHTMLFragments(GridField $gridField)

Parameters

GridField $gridField

Return Value

array

at line 329
$this setItemsPerPage(int $num)

Parameters

int $num

Return Value

$this

at line 338
Int getItemsPerPage()

Return Value

Int