mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02: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(
|
||||
'tr',
|
||||
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;
|
||||
}
|
||||
|
@ -87,6 +87,8 @@ class GridFieldPaginator implements GridField_HTMLProvider, GridField_DataManipu
|
||||
// Figure out which page and record range we're on
|
||||
$countList = clone $gridField->List;
|
||||
$totalRows = $countList->limit(null)->count();
|
||||
if(!$totalRows) return array();
|
||||
|
||||
$totalPages = ceil($totalRows/$this->itemsPerPage);
|
||||
if($totalPages == 0)
|
||||
$totalPages = 1;
|
||||
|
Loading…
Reference in New Issue
Block a user