HIde settings in grid table

Hello,

In the holiday list doctype, there is a grid table in which the last column is for edit and settings. Employees are able to edit the total number of columns that are displayed. I want to hide whether globally or for a specific role doesn’t matter. Are there any solutions to this?

Thanks

Hi @erpnxt_user,

So apply Role Permission Manager for Holiday list and set only system manager can Read, Write, Create and Delete it.

And for all Employee or another user for set like:

Thank You!

1 Like

And using script for hidden some button like:

frappe.ui.form.on('Holiday List', {
	refresh:function(frm, cdt, cdn){
	    cur_frm.fields_dict['holidays'].grid.wrapper.find('.grid-remove-rows').hide();
        cur_frm.fields_dict['holidays'].grid.wrapper.find('.grid-add-row').hide();
        cur_frm.fields_dict['holidays'].grid.wrapper.find('.btn-open-row').hide();
        cur_frm.fields_dict['holidays'].grid.wrapper.find('.grid-pagination').hide();
	}
});

Thank You!

1 Like

Hi @NCP

Thanks everything works great but my main problem was this box:

I’ve already set permission but employees are still able to change this by clicking on that setting button.

Thanks

Hmm :thinking:

Ok, I will try for it.

Thanks.

Thanks

Hi @erpnxt_user,

Please check it.

frappe.ui.form.on('Holiday List', {
    refresh:function(frm, cdt, cdn) {
        cur_frm.fields_dict['holidays'].grid.wrapper.find('div.d-flex').css({'visibility':'hidden'});
    }
}); 

Thank You!

1 Like

awesome…Thanks

1 Like