Page 1 of 1

Hiding add/reordering buttons in the grid widget

PostPosted: Fri Sep 16, 2011 4:35 am
by alexchet
Hi,
I use grid widget to edit related records. I want hide Add (+) and Reorder buttons and show only Delete one. Is there any way to do that?

Re: Hiding add/reordering buttons in the grid widget

PostPosted: Fri Sep 16, 2011 9:45 am
by shannah
You can either use CSS or permissions. If the user is not granted the reorder_related_records permission for that relationship then they should disappear. Alternatively you can just look at the HTML and figure out the css to hide the buttons.

-Steve

Re: Hiding add/reordering buttons in the grid widget

PostPosted: Sat Sep 17, 2011 7:24 pm
by alexchet
Thanks for the answer!
Unfortunately class HTML_QuickForm_grid does not check reorder_related_records permission :(
So I have to replace
Code: Select all
var $reorder=true;
with
Code: Select all
var $reorder=false;

at line 22 grid.php and got what I need.