When editing resources, there are some buttons on the top-right of the manger page:
«Save», «Duplicate», «Delete», «View», «Close», «Help!»
Some of our clients tend to click on the «Delete» button, when they, in fact, want to delete a row inside a MIGX grid. (Don't ask! It happend with two different clients.)
I want to hide the «Delete» and maybe «Duplicate» button but still let the user delete a resource by right-clicking it in the resource tree.
Because of that, taking away the permission with ACL's is not an option.
I have two proposed solutions for this.
Both involve a plugin that checks the user-group and then hides the buttons by:
- registering CSS (proposed by @mindeffects)
- registering JS (proposed by mark_hamstra)*
* by using Ext.getCmp(‘ID’).hide();
Question 1
Is there another, better option to hide those buttons
Question 2
The ID of the table-cell of the buttons are something like: "ext-gen300".
Inside that cell is another table with id: "modx-abtn-delete"
The latter seems unique but leaves an empty table-cell when hidden.
<td class="x-toolbar-cell" id="ext-gen300"><table id="modx-abtn-delete" cellspacing="0" class="x-btn x-btn-text bmenu x-btn-noicon" style="width: auto; "> [...] </table></td>
So the question would be:
Can I savely hide that table-cell "ext-gen300" or is that just a sequentially generated number, that could change?
Question 3
Anyone has a plugIn, that does exactly that, and wants to share?
Sascha