mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
MINOR Don't show GridField pagination when no records are found, and ensure the "no results" message is laid out correctly
This commit is contained in:
parent
174cf08c75
commit
b321b9b995
@ -358,7 +358,7 @@ class GridField extends FormField {
|
|||||||
$row = $this->createTag(
|
$row = $this->createTag(
|
||||||
'tr',
|
'tr',
|
||||||
array("class" => 'ss-gridfield-item ss-gridfield-no-items'),
|
array("class" => 'ss-gridfield-item ss-gridfield-no-items'),
|
||||||
$this->createTag('td', array(), _t('GridField.NoItemsFound', 'No items found'))
|
$this->createTag('td', array('colspan' => count($columns)), _t('GridField.NoItemsFound', 'No items found'))
|
||||||
);
|
);
|
||||||
$content['body'][] = $row;
|
$content['body'][] = $row;
|
||||||
}
|
}
|
||||||
|
@ -87,6 +87,8 @@ class GridFieldPaginator implements GridField_HTMLProvider, GridField_DataManipu
|
|||||||
// Figure out which page and record range we're on
|
// Figure out which page and record range we're on
|
||||||
$countList = clone $gridField->List;
|
$countList = clone $gridField->List;
|
||||||
$totalRows = $countList->limit(null)->count();
|
$totalRows = $countList->limit(null)->count();
|
||||||
|
if(!$totalRows) return array();
|
||||||
|
|
||||||
$totalPages = ceil($totalRows/$this->itemsPerPage);
|
$totalPages = ceil($totalRows/$this->itemsPerPage);
|
||||||
if($totalPages == 0)
|
if($totalPages == 0)
|
||||||
$totalPages = 1;
|
$totalPages = 1;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user