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
Add actions column to grids #14806
Add actions column to grids #14806
Conversation
Great PR, thanks! But it seems to me that in "Contexts" section it’s worth removing additional menu items, leaving only the gear (although I argued the opposite in other PR). |
In section ( |
And it is worth renaming |
I'm not sure what the options should be in the context grid. Seems like the edit action could be used quite often so might be worth it's direct icon in the actions column (not sure if it should get removed from the context menu or if it should be there as well - worth a discussion I guess). Those sections you mentioned, they fall into the part where I'm not sure if this functionality should be enabled or disabled by default. If it will be enabled (the current state in the PR), I'll have to adjust all grids without a context menu and disable the actions column - as it wouldn't trigger any action (like you are reporting). Maybe I'm leaning towards disabling this feature by default (the opposite of the current state). Yes it can be |
Would it be possible to have the gear show the same actions/options as the context menu? This would also solve issues with devices that don't support a secondary click like mobile devices and tablets. |
@JoshuaLuckers that's what it does. You don't have to define other actions to the new column and the gear icon will open the context menu (the standard one). |
Nice! I've made a small tweak to make sure it respects the width config property, and also disabled the gear icon on the packages grid. There'll probably be other places where it needs to be disabled, but I can see this giving grids a massive usability boost! |
…14806] Merge remote-tracking branch 'upstream/pr/14806' into 3.x
@Mark-H For contexts, it’s worth removing unnecessary items, the gear icon is enough. |
What does it do?
Added new properties to
MODx.grid.Grid
andMODx.grid.LocalGrid
true
, shows the new actions columntrue
thegear
icon won't show upAdded new method that other grids extending
Grid
orLocalGrid
can implement:getActions
. It's getting these params:record
,rowIndex
,colIndex
,store
and should return an array or objects with properties:Those will get displayed as action buttons in the actions column.
I'm not 100% sure if this should be enabled or disabled by default, when it's enabled by default grids without any actions / items in getMenu will have to disable this. If it's enabled by default, grids with actions / items in getMenu will have to enable this.
Why is it needed?
Seems like context menus are not intuitive enough for people :)
Related issue(s)/PR(s)
Improves PR #14581 and #14125
Should resolve #14125
Screenshots
Contexts grid
System Settings
User Groups (Local Grid)