Skip to content
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

[3.x] Grid column sizing might be way off due to gear icon for context menu #14859

Closed
Mark-H opened this issue Nov 29, 2019 · 2 comments
Closed

Comments

@Mark-H
Copy link
Collaborator

Mark-H commented Nov 29, 2019

Bug report

Summary

In #14806, a new column is dynamically added to all (incl third party) grids, with a width of 50.

Works great, until you're loading a third party grid that is not defined in "pixel-ish" values, but in "percentage-ish". Because widths are relative to the total, one could be defining grid columns with widths of "0.2", "0.5", "0.3" for a total of 1, and ExtJS will calculate that to the proper pixel values on render.

Now imagine what that looks like when a magic column with a default width of 50 is added... your total is 51, 50 of which goes to the gear icon.

Step to reproduce

Install an extra that defines "percentage-ish" widths for columns instead of "pixel-ish". I ran across it with ClientConfig's admin view, but I'm sure there are others.

Observed behavior

Schermafbeelding 2019-11-29 om 23 43 18

Expected behavior

I'm not quire sure - mostly posting this to see what others and in particular @theboxer think. It's a simple fix, where the extra can define the width of the column (config.actionsColumnWidth)... but maybe there are some bright ideas on other solutions.

Environment

3.x branch from today

@theboxer
Copy link
Member

theboxer commented Dec 2, 2019

@Mark-H I'm still not 100% sold on if the new "gear" column should be enabled by default...

And to the issue with percentages: Adding a config to be able to define own width is fairly simple and I'd add it for sure. We can also try to guess if you're using percentage based width (I actually never used it, and from a quick look at ClientConfig, it seems that we can check if width of every column is < 1, correct me if my thinking is wrong please) and use a default percentage with as well.

@Ruslan-Aleev
Copy link
Collaborator

Must be enabled by default. Without the new context menu, it’s not at all clear that the elements in the grid can be changed, you can find out only by accident, probably :) especially if you are just starting to work with MODX.
And for mobile versions, too, because on mobile devices there is no right mouse button.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants