mirror of
https://github.com/silverstripe/silverstripe-reports
synced 2024-09-29 12:49:15 +02:00
Merge pull request #1003 from tractorcow/pulls/3.1-configurable-paging
API Ability to configure paging for assets / pages
This commit is contained in:
commit
66919ed0cc
@ -16,6 +16,14 @@ class AssetAdmin extends LeftAndMain implements PermissionProvider{
|
|||||||
|
|
||||||
private static $tree_class = 'Folder';
|
private static $tree_class = 'Folder';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Amount of results showing on a single page.
|
||||||
|
*
|
||||||
|
* @config
|
||||||
|
* @var int
|
||||||
|
*/
|
||||||
|
private static $page_length = 15;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @config
|
* @config
|
||||||
* @see Upload->allowedMaxFileSize
|
* @see Upload->allowedMaxFileSize
|
||||||
@ -150,9 +158,9 @@ JS
|
|||||||
$gridFieldConfig = GridFieldConfig::create()->addComponents(
|
$gridFieldConfig = GridFieldConfig::create()->addComponents(
|
||||||
new GridFieldToolbarHeader(),
|
new GridFieldToolbarHeader(),
|
||||||
new GridFieldSortableHeader(),
|
new GridFieldSortableHeader(),
|
||||||
new GridFieldFilterHeader(),
|
new GridFieldFilterHeader(),
|
||||||
new GridFieldDataColumns(),
|
new GridFieldDataColumns(),
|
||||||
new GridFieldPaginator(15),
|
new GridFieldPaginator(self::config()->page_length),
|
||||||
new GridFieldEditButton(),
|
new GridFieldEditButton(),
|
||||||
new GridFieldDeleteAction(),
|
new GridFieldDeleteAction(),
|
||||||
new GridFieldDetailForm(),
|
new GridFieldDetailForm(),
|
||||||
|
@ -27,6 +27,14 @@ class CMSMain extends LeftAndMain implements CurrentPageIdentifier, PermissionPr
|
|||||||
|
|
||||||
private static $subitem_class = "Member";
|
private static $subitem_class = "Member";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Amount of results showing on a single page.
|
||||||
|
*
|
||||||
|
* @config
|
||||||
|
* @var int
|
||||||
|
*/
|
||||||
|
private static $page_length = 15;
|
||||||
|
|
||||||
private static $allowed_actions = array(
|
private static $allowed_actions = array(
|
||||||
'buildbrokenlinks',
|
'buildbrokenlinks',
|
||||||
'deleteitems',
|
'deleteitems',
|
||||||
@ -726,7 +734,7 @@ class CMSMain extends LeftAndMain implements CurrentPageIdentifier, PermissionPr
|
|||||||
$gridFieldConfig = GridFieldConfig::create()->addComponents(
|
$gridFieldConfig = GridFieldConfig::create()->addComponents(
|
||||||
new GridFieldSortableHeader(),
|
new GridFieldSortableHeader(),
|
||||||
new GridFieldDataColumns(),
|
new GridFieldDataColumns(),
|
||||||
new GridFieldPaginator(15)
|
new GridFieldPaginator(self::config()->page_length)
|
||||||
);
|
);
|
||||||
if($parentID){
|
if($parentID){
|
||||||
$gridFieldConfig->addComponent(
|
$gridFieldConfig->addComponent(
|
||||||
|
Loading…
Reference in New Issue
Block a user