Open clarkepaul opened 7 years ago
The gridfield item count is not required when there is no gridfield title directly above the grid as it causes an unwanted space.
What do you mean "not required"? Why is it required when there is a title?
I would rather re-arranging the header so that it could fit without it being removed. It's important information that affects information communicated to the content editor; They now need to scroll to the bottom to see how many items are in this list.
Alternate solution:
Before:
After:
diff --git a/src/Forms/GridField/GridFieldConfig_RecordEditor.php b/src/Forms/GridField/GridFieldConfig_RecordEditor.php
index 8e30b3d02..ea24e5238 100644
--- a/src/Forms/GridField/GridFieldConfig_RecordEditor.php
+++ b/src/Forms/GridField/GridFieldConfig_RecordEditor.php
@@ -29,7 +29,7 @@ class GridFieldConfig_RecordEditor extends GridFieldConfig
}
$this->addComponent(new GridFieldEditButton());
$this->addComponent(new GridFieldDeleteAction());
- $this->addComponent(new GridFieldPageCount('toolbar-header-right'));
+ $this->addComponent(new GridFieldPageCount('buttons-before-right'));
$this->addComponent($pagination = new GridFieldPaginator($itemsPerPage));
$this->addComponent(new GridFieldDetailForm());
@clarkepaul is this ok?
I'm in favour of @tractorcow's suggestion. Removing the count when there's no title seems like unintended loss of data, title shouldn't be linked to the count in that way.
If it was a clean "remove count from the top", then I'd agree with that, since the count is also available at the bottom of the gridfield
@clarkepaul can you please comment and let us know if this is ok. I can make the changes if so.
Good idea there, although I'm not sure what actions will end up in that place (right side on gridfields). I know the "link to existing records" action lives there but I want to remove that interaction to be coupled with the "Add" action or at least next to it as a smaller action.
Some of my reasoning for not needing that information is that the gridfields are small enough for most screens to be able to see the bottom with pagination and same info at the bottom, and this info at the top is a factor from preventing people from accessing the page info & pagination at the bottom which is more important.
I guess we can place the "link existing" action to the left of this data for now, can you just align the bottom of the text with the actions on the left please. Happy to proceed with change if others can't think of any other actions on the right side.
Link to existing records is a row below that, I think.
Oh, it's right. But, I can make it conditional... if you have a title, page count will go beside it. If you don't have a title, it'll go in the button row.
Sorry for resurecting this issue, but the fix did not solve the main problem - unwanted space.
I've attached a screenshot with highlighted empty toolbar header (on 4.1.0-rc2):
I think, you should have to remove GridFieldToolbarHeader itself to get rid of that empty space.
Also, the fix addesses only the SecurityAdmin. It would be nice to have this in ModelAdmin too.
The gridfield item count is not required when there is no gridfield title directly above the grid as it causes an unwanted space. By removing the view count at the top the gridfield actions will be closer to the gridfield providing a clearer UX.
We could also remove it all together (whether there is a header or not), but it doesn't seem to do any harm when there is a header present.
Pull request
https://github.com/silverstripe/silverstripe-framework/pull/7646