-
Notifications
You must be signed in to change notification settings - Fork 95
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove the gridfield item count from the top of gridfields when there is no header #256
Comments
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. 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. |
New fix at #403 |
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
Hide gridfield page count when there's no title silverstripe-framework#7646The text was updated successfully, but these errors were encountered: